diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
+   blocks. */
+pre code, pre kbd, pre samp { font-size: 100%; }
+
+/* Used to denote text that shouldn't be selectable, such as line numbers or
+   shell prompts. Guess which browser this doesn't work in. */
+.noselect {
+    -moz-user-select: -moz-none;
+    -khtml-user-select: none;
+    -webkit-user-select: none;
+    -o-user-select: none;
+    user-select: none;
+}
+
+/* -- Lists ----------------------------------------------------------------- */
+dd { margin: 0.2em 0 0.7em 1em; }
+dl { margin: 1em 0; }
+dt { font-weight: bold; }
+
+/* -- Tables ---------------------------------------------------------------- */
+caption, th { text-align: left; }
+
+table {
+    border-collapse: collapse;
+    width: 100%;
+}
+
+td, th {
+    border: 1px solid #fff;
+    padding: 5px 12px;
+    vertical-align: top;
+}
+
+td { background: #E6E9F5; }
+td dl { margin: 0; }
+td dl dl { margin: 1em 0; }
+td pre:first-child { margin-top: 0; }
+
+th {
+    background: #D2D7E6;/*#97A0BF*/
+    border-bottom: none;
+    border-top: none;
+    color: #000;/*#FFF1D5*/
+    font-family: 'Trebuchet MS', sans-serif;
+    font-weight: bold;
+    line-height: 1.3;
+    white-space: nowrap;
+}
+
+
+/* -- Layout and Content ---------------------------------------------------- */
+#doc {
+    margin: auto;
+    min-width: 1024px;
+}
+
+.content { padding: 0 20px 0 25px; }
+
+.sidebar {
+    padding: 0 15px 0 10px;
+}
+#bd {
+    padding: 7px 0 130px;
+    position: relative;
+    width: 99%;
+}
+
+/* -- Table of Contents ----------------------------------------------------- */
+
+/* The #toc id refers to the single global table of contents, while the .toc
+   class refers to generic TOC lists that could be used throughout the page. */
+
+.toc code, .toc kbd, .toc samp { font-size: 100%; }
+.toc li { font-weight: bold; }
+.toc li li { font-weight: normal; }
+
+/* -- Intro and Example Boxes ----------------------------------------------- */
+/*
+.intro, .example { margin-bottom: 2em; }
+.example {
+    -moz-border-radius: 4px;
+    -webkit-border-radius: 4px;
+    border-radius: 4px;
+    -moz-box-shadow: 0 0 5px #bfbfbf;
+    -webkit-box-shadow: 0 0 5px #bfbfbf;
+    box-shadow: 0 0 5px #bfbfbf;
+    padding: 1em;
+}
+.intro {
+    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
+}
+*/
+
+/* -- Other Styles ---------------------------------------------------------- */
+
+/* These are probably YUI-specific, and should be moved out of Selleck's default
+   theme. */
+
+.button {
+    border: 1px solid #dadada;
+    -moz-border-radius: 3px;
+    -webkit-border-radius: 3px;
+    border-radius: 3px;
+    color: #444;
+    display: inline-block;
+    font-family: Helvetica, Arial, sans-serif;
+    font-size: 92.308%;
+    font-weight: bold;
+    padding: 4px 13px 3px;
+    -moz-text-shadow: 1px 1px 0 #fff;
+    -webkit-text-shadow: 1px 1px 0 #fff;
+    text-shadow: 1px 1px 0 #fff;
+    white-space: nowrap;
+
+    background: #EFEFEF; /* old browsers */
+    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
+    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
+}
+
+.button:hover {
+    border-color: #466899;
+    color: #fff;
+    text-decoration: none;
+    -moz-text-shadow: 1px 1px 0 #222;
+    -webkit-text-shadow: 1px 1px 0 #222;
+    text-shadow: 1px 1px 0 #222;
+
+    background: #6396D8; /* old browsers */
+    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
+    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
+}
+
+.newwindow { text-align: center; }
+
+.header .version em {
+    display: block;
+    text-align: right;
+}
+
+
+#classdocs .item {
+    border-bottom: 1px solid #466899;
+    margin: 1em 0;
+    padding: 1.5em;
+}
+
+#classdocs .item .params p,
+    #classdocs .item .returns p,{
+    display: inline;
+}
+
+#classdocs .item em code, #classdocs .item em.comment {
+    color: green;
+}
+
+#classdocs .item em.comment a {
+    color: green;
+    text-decoration: underline;
+}
+
+#classdocs .foundat {
+    font-size: 11px;
+    font-style: normal;
+}
+
+.attrs .emits {
+    margin-left: 2em;
+    padding: .5em;
+    border-left: 1px dashed #ccc;
+}
+
+abbr {
+    border-bottom: 1px dashed #ccc;
+    font-size: 80%;
+    cursor: help;
+}
+
+.prettyprint li.L0, 
+.prettyprint li.L1, 
+.prettyprint li.L2, 
+.prettyprint li.L3, 
+.prettyprint li.L5, 
+.prettyprint li.L6, 
+.prettyprint li.L7, 
+.prettyprint li.L8 {
+    list-style: decimal;
+}
+
+ul li p {
+    margin-top: 0;
+}
+
+.method .name {
+    font-size: 110%;
+}
+
+.apidocs .methods .extends .method,
+.apidocs .properties .extends .property,
+.apidocs .attrs .extends .attr,
+.apidocs .events .extends .event {
+    font-weight: bold;
+}
+
+.apidocs .methods .extends .inherited,
+.apidocs .properties .extends .inherited,
+.apidocs .attrs .extends .inherited,
+.apidocs .events .extends .inherited {
+    font-weight: normal;
+}
+
+#hd {
+    background: whiteSmoke;
+    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
+    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
+    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
+    border-bottom: 1px solid #DFDFDF;
+    padding: 0 15px 1px 20px;
+    margin-bottom: 15px;
+}
+
+#hd img {
+    margin-right: 10px;
+    vertical-align: middle;
+}
+
+
+/* -- API Docs CSS ---------------------------------------------------------- */
+
+/*
+This file is organized so that more generic styles are nearer the top, and more
+specific styles are nearer the bottom of the file. This allows us to take full
+advantage of the cascade to avoid redundant style rules. Please respect this
+convention when making changes.
+*/
+
+/* -- Generic TabView styles ------------------------------------------------ */
+
+/*
+These styles apply to all API doc tabviews. To change styles only for a
+specific tabview, see the other sections below.
+*/
+
+.yui3-js-enabled .apidocs .tabview {
+    visibility: hidden; /* Hide until the TabView finishes rendering. */
+    _visibility: visible;
+}
+
+.apidocs .tabview.yui3-tabview-content { visibility: visible; }
+.apidocs .tabview .yui3-tabview-panel { background: #fff; }
+
+/* -- Generic Content Styles ------------------------------------------------ */
+
+/* Headings */
+h2, h3, h4, h5, h6 {
+    border: none;
+    color: #30418C;
+    font-weight: bold;
+    text-decoration: none;
+}
+
+.link-docs {
+    float: right;
+    font-size: 15px;
+    margin: 4px 4px 6px;
+    padding: 6px 30px 5px;
+}
+
+.apidocs { zoom: 1; }
+
+/* Generic box styles. */
+.apidocs .box {
+    border: 1px solid;
+    border-radius: 3px;
+    margin: 1em 0;
+    padding: 0 1em;
+}
+
+/* A flag is a compact, capsule-like indicator of some kind. It's used to
+   indicate private and protected items, item return types, etc. in an
+   attractive and unobtrusive way. */
+.apidocs .flag {
+    background: #bababa;
+    border-radius: 3px;
+    color: #fff;
+    font-size: 11px;
+    margin: 0 0.5em;
+    padding: 2px 4px 1px;
+}
+
+/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
+.apidocs .meta {
+    background: #f9f9f9;
+    border-color: #efefef;
+    color: #555;
+    font-size: 11px;
+    padding: 3px 6px;
+}
+
+.apidocs .meta p { margin: 0; }
+
+/* Deprecation warning. */
+.apidocs .box.deprecated,
+.apidocs .flag.deprecated {
+    background: #fdac9f;
+    border: 1px solid #fd7775;
+}
+
+.apidocs .box.deprecated p { margin: 0.5em 0; }
+.apidocs .flag.deprecated { color: #333; }
+
+/* Module/Class intro description. */
+.apidocs .intro {
+    background: #f0f1f8;
+    border-color: #d4d8eb;
+}
+
+/* Loading spinners. */
+#bd.loading .apidocs,
+#api-list.loading .yui3-tabview-panel {
+    background: #fff url(../img/spinner.gif) no-repeat center 70px;
+    min-height: 150px;
+}
+
+#bd.loading .apidocs .content,
+#api-list.loading .yui3-tabview-panel .apis {
+    display: none;
+}
+
+.apidocs .no-visible-items { color: #666; }
+
+/* Generic inline list. */
+.apidocs ul.inline {
+    display: inline;
+    list-style: none;
+    margin: 0;
+    padding: 0;
+}
+
+.apidocs ul.inline li { display: inline; }
+
+/* Comma-separated list. */
+.apidocs ul.commas li:after { content: ','; }
+.apidocs ul.commas li:last-child:after { content: ''; }
+
+/* Keyboard shortcuts. */
+kbd .cmd { font-family: Monaco, Helvetica; }
+
+/* -- Generic Access Level styles ------------------------------------------- */
+.apidocs .item.protected,
+.apidocs .item.private,
+.apidocs .index-item.protected,
+.apidocs .index-item.deprecated,
+.apidocs .index-item.private {
+    display: none;
+}
+
+.show-deprecated .item.deprecated,
+.show-deprecated .index-item.deprecated,
+.show-protected .item.protected,
+.show-protected .index-item.protected,
+.show-private .item.private,
+.show-private .index-item.private {
+    display: block;
+}
+
+.hide-inherited .item.inherited,
+.hide-inherited .index-item.inherited {
+    display: none;
+}
+
+/* -- Generic Item Index styles --------------------------------------------- */
+.apidocs .index { margin: 1.5em 0 3em; }
+
+.apidocs .index h3 {
+    border-bottom: 1px solid #efefef;
+    color: #333;
+    font-size: 13px;
+    margin: 2em 0 0.6em;
+    padding-bottom: 2px;
+}
+
+.apidocs .index .no-visible-items { margin-top: 2em; }
+
+.apidocs .index-list {
+    border-color: #efefef;
+    font-size: 12px;
+    list-style: none;
+    margin: 0;
+    padding: 0;
+    -moz-column-count: 4;
+    -moz-column-gap: 10px;
+    -moz-column-width: 170px;
+    -ms-column-count: 4;
+    -ms-column-gap: 10px;
+    -ms-column-width: 170px;
+    -o-column-count: 4;
+    -o-column-gap: 10px;
+    -o-column-width: 170px;
+    -webkit-column-count: 4;
+    -webkit-column-gap: 10px;
+    -webkit-column-width: 170px;
+    column-count: 4;
+    column-gap: 10px;
+    column-width: 170px;
+}
+
+.apidocs .no-columns .index-list {
+    -moz-column-count: 1;
+    -ms-column-count: 1;
+    -o-column-count: 1;
+    -webkit-column-count: 1;
+    column-count: 1;
+}
+
+.apidocs .index-item { white-space: nowrap; }
+
+.apidocs .index-item .flag {
+    background: none;
+    border: none;
+    color: #afafaf;
+    display: inline;
+    margin: 0 0 0 0.2em;
+    padding: 0;
+}
+
+/* -- Generic API item styles ----------------------------------------------- */
+.apidocs .args {
+    display: inline;
+    margin: 0 0.5em;
+}
+
+.apidocs .flag.chainable { background: #46ca3b; }
+.apidocs .flag.protected { background: #9b86fc; }
+.apidocs .flag.private { background: #fd6b1b; }
+.apidocs .flag.async { background: #356de4; }
+.apidocs .flag.required { background: #e60923; }
+
+.apidocs .item {
+    border-bottom: 1px solid #efefef;
+    margin: 1.5em 0 2em;
+    padding-bottom: 2em;
+}
+
+.apidocs .item h4,
+.apidocs .item h5,
+.apidocs .item h6 {
+    color: #333;
+    font-family: inherit;
+    font-size: 100%;
+}
+
+.apidocs .item .description p,
+.apidocs .item pre.code {
+    margin: 1em 0 0;
+}
+
+.apidocs .item .meta {
+    background: none;
+    border: none;
+    padding: 0;
+}
+
+.apidocs .item .name {
+    display: inline;
+    font-size: 14px;
+}
+
+.apidocs .item .type,
+.apidocs .item .type a,
+.apidocs .returns-inline {
+    color: #555;
+}
+
+.apidocs .item .type,
+.apidocs .returns-inline {
+    font-size: 11px;
+    margin: 0 0 0 0;
+}
+
+.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
+.apidocs .item .type a:hover { border: none; }
+
+/* -- Item Parameter List --------------------------------------------------- */
+.apidocs .params-list {
+    list-style: square;
+    margin: 1em 0 0 2em;
+    padding: 0;
+}
+
+.apidocs .param { margin-bottom: 1em; }
+
+.apidocs .param .type,
+.apidocs .param .type a {
+    color: #666;
+}
+
+.apidocs .param .type {
+    margin: 0 0 0 0.5em;
+    *margin-left: 0.5em;
+}
+
+.apidocs .param-name { font-weight: bold; }
+
+/* -- Item "Emits" block ---------------------------------------------------- */
+.apidocs .item .emits {
+    background: #f9f9f9;
+    border-color: #eaeaea;
+}
+
+/* -- Item "Returns" block -------------------------------------------------- */
+.apidocs .item .returns .type,
+.apidocs .item .returns .type a {
+    font-size: 100%;
+    margin: 0;
+}
+
+/* -- Class Constructor block ----------------------------------------------- */
+.apidocs .constructor .item {
+    border: none;
+    padding-bottom: 0;
+}
+
+/* -- File Source View ------------------------------------------------------ */
+.apidocs .file pre.code,
+#doc .apidocs .file pre.prettyprint {
+    background: inherit;
+    border: none;
+    overflow: visible;
+    padding: 0;
+}
+
+.apidocs .L0,
+.apidocs .L1,
+.apidocs .L2,
+.apidocs .L3,
+.apidocs .L4,
+.apidocs .L5,
+.apidocs .L6,
+.apidocs .L7,
+.apidocs .L8,
+.apidocs .L9 {
+    background: inherit;
+}
+
+/* -- Submodule List -------------------------------------------------------- */
+.apidocs .module-submodule-description {
+    font-size: 12px;
+    margin: 0.3em 0 1em;
+}
+
+.apidocs .module-submodule-description p:first-child { margin-top: 0; }
+
+/* -- Sidebar TabView ------------------------------------------------------- */
+#api-tabview { margin-top: 0.6em; }
+
+#api-tabview-filter,
+#api-tabview-panel {
+    border: 1px solid #dfdfdf;
+}
+
+#api-tabview-filter {
+    border-bottom: none;
+    border-top: none;
+    padding: 0.6em 10px 0 10px;
+}
+
+#api-tabview-panel { border-top: none; }
+#api-filter { width: 97%; }
+
+/* -- Content TabView ------------------------------------------------------- */
+#classdocs .yui3-tabview-panel { border: none; }
+
+/* -- Source File Contents -------------------------------------------------- */
+.prettyprint li.L0,
+.prettyprint li.L1,
+.prettyprint li.L2,
+.prettyprint li.L3,
+.prettyprint li.L5,
+.prettyprint li.L6,
+.prettyprint li.L7,
+.prettyprint li.L8 {
+    list-style: decimal;
+}
+
+/* -- API options ----------------------------------------------------------- */
+#api-options {
+    font-size: 11px;
+    margin-top: 2.2em;
+    position: absolute;
+    right: 1.5em;
+}
+
+/*#api-options label { margin-right: 0.6em; }*/
+
+/* -- API list -------------------------------------------------------------- */
+#api-list {
+    margin-top: 1.5em;
+    *zoom: 1;
+}
+
+.apis {
+    font-size: 12px;
+    line-height: 1.4;
+    list-style: none;
+    margin: 0;
+    padding: 0.5em 0 0.5em 0.4em;
+}
+
+.apis a {
+    border: 1px solid transparent;
+    display: block;
+    margin: 0 0 0 -4px;
+    padding: 1px 4px 0;
+    text-decoration: none;
+    _border: none;
+    _display: inline;
+}
+
+.apis a:hover,
+.apis a:focus {
+    background: #E8EDFC;
+    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
+    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
+    border-color: #AAC0FA;
+    border-radius: 3px;
+    color: #333;
+    outline: none;
+}
+
+.api-list-item a:hover,
+.api-list-item a:focus {
+    font-weight: bold;
+    text-shadow: 1px 1px 1px #fff;
+}
+
+.apis .message { color: #888; }
+.apis .result a { padding: 3px 5px 2px; }
+
+.apis .result .type {
+    right: 4px;
+    top: 7px;
+}
+
+.api-list-item .yui3-highlight {
+    font-weight: bold;
+}
+

diff --git a/README.md b/README.md
index d012149..0dd6b82 100644
--- a/README.md
+++ b/README.md
@@ -14,13 +14,12 @@
 ### Current features ###
 
 - webGL renderer (with automatic smart batching allowing for REALLY fast performance)
-- canvas renderer 
+- canvas renderer
 - full scene graph
-- super easy to use API (similar to the flash display list API)
+- super easy to use API (similar to twhe flash display list API)
 - support for texture atlas's
 - asset loader / sprite sheet loader
 - auto detect which renderer should be used
-- handles device context loss
 
 ### Coming soon ###
 
@@ -48,8 +47,8 @@
 	
 	var stage = new PIXI.Stage;
 
-	var bunnyTexture = new PIXI.Texture("bunny.png");
-	var bunny = new PIXI.Sprite(rabbitTexture);
+	var bunnyTexture = new PIXI.Texture.fromImage("bunny.png");
+	var bunny = new PIXI.Sprite(bunnyTexture);
 	
 	bunny.position.x = 400;
 	bunny.position.y = 300;
diff --git a/bin/pixi.js b/bin/pixi.js
index df5858d..65add09 100644
--- a/bin/pixi.js
+++ b/bin/pixi.js
@@ -1,4 +1,4 @@
-window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)};
+var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)};
 var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a,
 d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j*
 j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b=
@@ -45,7 +45,7 @@
 (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType=
 f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"];
 PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"];
-PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l
    
-  	 
+  	 
   	 
 
-  	 	
+        
       
+        
+      	
         
       	
 		
+
 		
 		
-		
-		
-      	
-      	
 		
+		
+		
+		
+		
+      	
 		
 		
 		
 		
 		
 		
+		
 		
 		
+		
 		
 		
 		
+		
+	
       
  
 	
diff --git a/docs/api.js b/docs/api.js
new file mode 100644
index 0000000..ac07693
--- /dev/null
+++ b/docs/api.js
@@ -0,0 +1,29 @@
+YUI.add("yuidoc-meta", function(Y) {
+   Y.YUIDoc = { meta: {
+    "classes": [
+        "AssetLoader",
+        "BaseTexture",
+        "CanvasRenderer",
+        "DisplayObject",
+        "DisplayObjectContainer",
+        "MovieClip",
+        "Point",
+        "Rectangle",
+        "Sprite",
+        "SpriteSheetLoader",
+        "Stage",
+        "Texture",
+        "WebGLBatch",
+        "WebGLRenderer"
+    ],
+    "modules": [
+        "PIXI"
+    ],
+    "allModules": [
+        {
+            "displayName": "PIXI",
+            "name": "PIXI"
+        }
+    ]
+} };
+});
\ No newline at end of file
diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png
new file mode 100644
index 0000000..759a1cd
--- /dev/null
+++ b/docs/assets/css/external-small.png
Binary files differ
diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png
new file mode 100644
index 0000000..609b336
--- /dev/null
+++ b/docs/assets/css/logo.png
Binary files differ
diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css
new file mode 100644
index 0000000..f8f7ee7
--- /dev/null
+++ b/docs/assets/css/main.css
@@ -0,0 +1,782 @@
+/*
+Font sizes for all selectors other than the body are given in percentages,
+with 100% equal to 13px. To calculate a font size percentage, multiply the
+desired size in pixels by 7.6923076923.
+
+Here's a quick lookup table:
+
+10px - 76.923%
+11px - 84.615%
+12px - 92.308%
+13px - 100%
+14px - 107.692%
+15px - 115.385%
+16px - 123.077%
+17px - 130.769%
+18px - 138.462%
+19px - 146.154%
+20px - 153.846%
+*/
+
+html {
+    background: #fff;
+    color: #333;
+    overflow-y: scroll;
+}
+
+body {
+    font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif;
+    margin: 0;
+    padding: 0;
+}
+
+/* -- Links ----------------------------------------------------------------- */
+a {
+    color: #356de4;
+    text-decoration: none;
+}
+
+.hidden {
+    display: none;
+}
+
+a:hover { text-decoration: underline; }
+
+/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from
+   sight until it's focused. */
+.jump {
+    position: absolute;
+    padding: 3px 6px;
+    left: -99999px;
+    top: 0;
+}
+
+.jump:focus { left: 40%; }
+
+/* -- Paragraphs ------------------------------------------------------------ */
+p { margin: 1.3em 0; }
+dd p, td p { margin-bottom: 0; }
+dd p:first-child, td p:first-child { margin-top: 0; }
+
+/* -- Headings -------------------------------------------------------------- */
+h1, h2, h3, h4, h5, h6 {
+    color: #D98527;/*was #f80*/
+    font-family: 'Trebuchet MS', sans-serif;
+    font-weight: bold;
+    line-height: 1.1;
+    margin: 1.1em 0 0.5em;
+}
+
+h1 {
+    font-size: 184.6%;
+    color: #30418C;
+    margin: 0.75em 0 0.5em;
+}
+
+h2 {
+    font-size: 153.846%;
+    color: #E48A2B;
+}
+
+h3 { font-size: 138.462%; }
+
+h4 {
+    border-bottom: 1px solid #DBDFEA;
+    color: #E48A2B;
+    font-size: 115.385%;
+    font-weight: normal;
+    padding-bottom: 2px;
+}
+
+h5, h6 { font-size: 107.692%; }
+
+/* -- Code and examples ----------------------------------------------------- */
+code, kbd, pre, samp {
+    font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;
+    font-size: 92.308%;
+    line-height: 1.35;
+}
+
+p code, p kbd, p samp {
+    background: #FCFBFA;
+    border: 1px solid #EFEEED;
+    padding: 0 3px;
+}
+
+a code, a kbd, a samp,
+pre code, pre kbd, pre samp,
+table code, table kbd, table samp,
+.intro code, .intro kbd, .intro samp,
+.toc code, .toc kbd, .toc samp {
+    background: none;
+    border: none;
+    padding: 0;
+}
+
+pre.code, pre.terminal, pre.cmd {
+    overflow-x: auto;
+    *overflow-x: scroll;
+    padding: 0.3em 0.6em;
+}
+
+pre.code {
+    background: #FCFBFA;
+    border: 1px solid #EFEEED;
+    border-left-width: 5px;
+}
+
+pre.terminal, pre.cmd {
+    background: #F0EFFC;
+    border: 1px solid #D0CBFB;
+    border-left: 5px solid #D0CBFB;
+}
+
+/* Don't reduce the font size of // elements inside 
+   blocks. */
+pre code, pre kbd, pre samp { font-size: 100%; }
+
+/* Used to denote text that shouldn't be selectable, such as line numbers or
+   shell prompts. Guess which browser this doesn't work in. */
+.noselect {
+    -moz-user-select: -moz-none;
+    -khtml-user-select: none;
+    -webkit-user-select: none;
+    -o-user-select: none;
+    user-select: none;
+}
+
+/* -- Lists ----------------------------------------------------------------- */
+dd { margin: 0.2em 0 0.7em 1em; }
+dl { margin: 1em 0; }
+dt { font-weight: bold; }
+
+/* -- Tables ---------------------------------------------------------------- */
+caption, th { text-align: left; }
+
+table {
+    border-collapse: collapse;
+    width: 100%;
+}
+
+td, th {
+    border: 1px solid #fff;
+    padding: 5px 12px;
+    vertical-align: top;
+}
+
+td { background: #E6E9F5; }
+td dl { margin: 0; }
+td dl dl { margin: 1em 0; }
+td pre:first-child { margin-top: 0; }
+
+th {
+    background: #D2D7E6;/*#97A0BF*/
+    border-bottom: none;
+    border-top: none;
+    color: #000;/*#FFF1D5*/
+    font-family: 'Trebuchet MS', sans-serif;
+    font-weight: bold;
+    line-height: 1.3;
+    white-space: nowrap;
+}
+
+
+/* -- Layout and Content ---------------------------------------------------- */
+#doc {
+    margin: auto;
+    min-width: 1024px;
+}
+
+.content { padding: 0 20px 0 25px; }
+
+.sidebar {
+    padding: 0 15px 0 10px;
+}
+#bd {
+    padding: 7px 0 130px;
+    position: relative;
+    width: 99%;
+}
+
+/* -- Table of Contents ----------------------------------------------------- */
+
+/* The #toc id refers to the single global table of contents, while the .toc
+   class refers to generic TOC lists that could be used throughout the page. */
+
+.toc code, .toc kbd, .toc samp { font-size: 100%; }
+.toc li { font-weight: bold; }
+.toc li li { font-weight: normal; }
+
+/* -- Intro and Example Boxes ----------------------------------------------- */
+/*
+.intro, .example { margin-bottom: 2em; }
+.example {
+    -moz-border-radius: 4px;
+    -webkit-border-radius: 4px;
+    border-radius: 4px;
+    -moz-box-shadow: 0 0 5px #bfbfbf;
+    -webkit-box-shadow: 0 0 5px #bfbfbf;
+    box-shadow: 0 0 5px #bfbfbf;
+    padding: 1em;
+}
+.intro {
+    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
+}
+*/
+
+/* -- Other Styles ---------------------------------------------------------- */
+
+/* These are probably YUI-specific, and should be moved out of Selleck's default
+   theme. */
+
+.button {
+    border: 1px solid #dadada;
+    -moz-border-radius: 3px;
+    -webkit-border-radius: 3px;
+    border-radius: 3px;
+    color: #444;
+    display: inline-block;
+    font-family: Helvetica, Arial, sans-serif;
+    font-size: 92.308%;
+    font-weight: bold;
+    padding: 4px 13px 3px;
+    -moz-text-shadow: 1px 1px 0 #fff;
+    -webkit-text-shadow: 1px 1px 0 #fff;
+    text-shadow: 1px 1px 0 #fff;
+    white-space: nowrap;
+
+    background: #EFEFEF; /* old browsers */
+    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
+    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
+}
+
+.button:hover {
+    border-color: #466899;
+    color: #fff;
+    text-decoration: none;
+    -moz-text-shadow: 1px 1px 0 #222;
+    -webkit-text-shadow: 1px 1px 0 #222;
+    text-shadow: 1px 1px 0 #222;
+
+    background: #6396D8; /* old browsers */
+    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
+    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
+}
+
+.newwindow { text-align: center; }
+
+.header .version em {
+    display: block;
+    text-align: right;
+}
+
+
+#classdocs .item {
+    border-bottom: 1px solid #466899;
+    margin: 1em 0;
+    padding: 1.5em;
+}
+
+#classdocs .item .params p,
+    #classdocs .item .returns p,{
+    display: inline;
+}
+
+#classdocs .item em code, #classdocs .item em.comment {
+    color: green;
+}
+
+#classdocs .item em.comment a {
+    color: green;
+    text-decoration: underline;
+}
+
+#classdocs .foundat {
+    font-size: 11px;
+    font-style: normal;
+}
+
+.attrs .emits {
+    margin-left: 2em;
+    padding: .5em;
+    border-left: 1px dashed #ccc;
+}
+
+abbr {
+    border-bottom: 1px dashed #ccc;
+    font-size: 80%;
+    cursor: help;
+}
+
+.prettyprint li.L0, 
+.prettyprint li.L1, 
+.prettyprint li.L2, 
+.prettyprint li.L3, 
+.prettyprint li.L5, 
+.prettyprint li.L6, 
+.prettyprint li.L7, 
+.prettyprint li.L8 {
+    list-style: decimal;
+}
+
+ul li p {
+    margin-top: 0;
+}
+
+.method .name {
+    font-size: 110%;
+}
+
+.apidocs .methods .extends .method,
+.apidocs .properties .extends .property,
+.apidocs .attrs .extends .attr,
+.apidocs .events .extends .event {
+    font-weight: bold;
+}
+
+.apidocs .methods .extends .inherited,
+.apidocs .properties .extends .inherited,
+.apidocs .attrs .extends .inherited,
+.apidocs .events .extends .inherited {
+    font-weight: normal;
+}
+
+#hd {
+    background: whiteSmoke;
+    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
+    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
+    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
+    border-bottom: 1px solid #DFDFDF;
+    padding: 0 15px 1px 20px;
+    margin-bottom: 15px;
+}
+
+#hd img {
+    margin-right: 10px;
+    vertical-align: middle;
+}
+
+
+/* -- API Docs CSS ---------------------------------------------------------- */
+
+/*
+This file is organized so that more generic styles are nearer the top, and more
+specific styles are nearer the bottom of the file. This allows us to take full
+advantage of the cascade to avoid redundant style rules. Please respect this
+convention when making changes.
+*/
+
+/* -- Generic TabView styles ------------------------------------------------ */
+
+/*
+These styles apply to all API doc tabviews. To change styles only for a
+specific tabview, see the other sections below.
+*/
+
+.yui3-js-enabled .apidocs .tabview {
+    visibility: hidden; /* Hide until the TabView finishes rendering. */
+    _visibility: visible;
+}
+
+.apidocs .tabview.yui3-tabview-content { visibility: visible; }
+.apidocs .tabview .yui3-tabview-panel { background: #fff; }
+
+/* -- Generic Content Styles ------------------------------------------------ */
+
+/* Headings */
+h2, h3, h4, h5, h6 {
+    border: none;
+    color: #30418C;
+    font-weight: bold;
+    text-decoration: none;
+}
+
+.link-docs {
+    float: right;
+    font-size: 15px;
+    margin: 4px 4px 6px;
+    padding: 6px 30px 5px;
+}
+
+.apidocs { zoom: 1; }
+
+/* Generic box styles. */
+.apidocs .box {
+    border: 1px solid;
+    border-radius: 3px;
+    margin: 1em 0;
+    padding: 0 1em;
+}
+
+/* A flag is a compact, capsule-like indicator of some kind. It's used to
+   indicate private and protected items, item return types, etc. in an
+   attractive and unobtrusive way. */
+.apidocs .flag {
+    background: #bababa;
+    border-radius: 3px;
+    color: #fff;
+    font-size: 11px;
+    margin: 0 0.5em;
+    padding: 2px 4px 1px;
+}
+
+/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
+.apidocs .meta {
+    background: #f9f9f9;
+    border-color: #efefef;
+    color: #555;
+    font-size: 11px;
+    padding: 3px 6px;
+}
+
+.apidocs .meta p { margin: 0; }
+
+/* Deprecation warning. */
+.apidocs .box.deprecated,
+.apidocs .flag.deprecated {
+    background: #fdac9f;
+    border: 1px solid #fd7775;
+}
+
+.apidocs .box.deprecated p { margin: 0.5em 0; }
+.apidocs .flag.deprecated { color: #333; }
+
+/* Module/Class intro description. */
+.apidocs .intro {
+    background: #f0f1f8;
+    border-color: #d4d8eb;
+}
+
+/* Loading spinners. */
+#bd.loading .apidocs,
+#api-list.loading .yui3-tabview-panel {
+    background: #fff url(../img/spinner.gif) no-repeat center 70px;
+    min-height: 150px;
+}
+
+#bd.loading .apidocs .content,
+#api-list.loading .yui3-tabview-panel .apis {
+    display: none;
+}
+
+.apidocs .no-visible-items { color: #666; }
+
+/* Generic inline list. */
+.apidocs ul.inline {
+    display: inline;
+    list-style: none;
+    margin: 0;
+    padding: 0;
+}
+
+.apidocs ul.inline li { display: inline; }
+
+/* Comma-separated list. */
+.apidocs ul.commas li:after { content: ','; }
+.apidocs ul.commas li:last-child:after { content: ''; }
+
+/* Keyboard shortcuts. */
+kbd .cmd { font-family: Monaco, Helvetica; }
+
+/* -- Generic Access Level styles ------------------------------------------- */
+.apidocs .item.protected,
+.apidocs .item.private,
+.apidocs .index-item.protected,
+.apidocs .index-item.deprecated,
+.apidocs .index-item.private {
+    display: none;
+}
+
+.show-deprecated .item.deprecated,
+.show-deprecated .index-item.deprecated,
+.show-protected .item.protected,
+.show-protected .index-item.protected,
+.show-private .item.private,
+.show-private .index-item.private {
+    display: block;
+}
+
+.hide-inherited .item.inherited,
+.hide-inherited .index-item.inherited {
+    display: none;
+}
+
+/* -- Generic Item Index styles --------------------------------------------- */
+.apidocs .index { margin: 1.5em 0 3em; }
+
+.apidocs .index h3 {
+    border-bottom: 1px solid #efefef;
+    color: #333;
+    font-size: 13px;
+    margin: 2em 0 0.6em;
+    padding-bottom: 2px;
+}
+
+.apidocs .index .no-visible-items { margin-top: 2em; }
+
+.apidocs .index-list {
+    border-color: #efefef;
+    font-size: 12px;
+    list-style: none;
+    margin: 0;
+    padding: 0;
+    -moz-column-count: 4;
+    -moz-column-gap: 10px;
+    -moz-column-width: 170px;
+    -ms-column-count: 4;
+    -ms-column-gap: 10px;
+    -ms-column-width: 170px;
+    -o-column-count: 4;
+    -o-column-gap: 10px;
+    -o-column-width: 170px;
+    -webkit-column-count: 4;
+    -webkit-column-gap: 10px;
+    -webkit-column-width: 170px;
+    column-count: 4;
+    column-gap: 10px;
+    column-width: 170px;
+}
+
+.apidocs .no-columns .index-list {
+    -moz-column-count: 1;
+    -ms-column-count: 1;
+    -o-column-count: 1;
+    -webkit-column-count: 1;
+    column-count: 1;
+}
+
+.apidocs .index-item { white-space: nowrap; }
+
+.apidocs .index-item .flag {
+    background: none;
+    border: none;
+    color: #afafaf;
+    display: inline;
+    margin: 0 0 0 0.2em;
+    padding: 0;
+}
+
+/* -- Generic API item styles ----------------------------------------------- */
+.apidocs .args {
+    display: inline;
+    margin: 0 0.5em;
+}
+
+.apidocs .flag.chainable { background: #46ca3b; }
+.apidocs .flag.protected { background: #9b86fc; }
+.apidocs .flag.private { background: #fd6b1b; }
+.apidocs .flag.async { background: #356de4; }
+.apidocs .flag.required { background: #e60923; }
+
+.apidocs .item {
+    border-bottom: 1px solid #efefef;
+    margin: 1.5em 0 2em;
+    padding-bottom: 2em;
+}
+
+.apidocs .item h4,
+.apidocs .item h5,
+.apidocs .item h6 {
+    color: #333;
+    font-family: inherit;
+    font-size: 100%;
+}
+
+.apidocs .item .description p,
+.apidocs .item pre.code {
+    margin: 1em 0 0;
+}
+
+.apidocs .item .meta {
+    background: none;
+    border: none;
+    padding: 0;
+}
+
+.apidocs .item .name {
+    display: inline;
+    font-size: 14px;
+}
+
+.apidocs .item .type,
+.apidocs .item .type a,
+.apidocs .returns-inline {
+    color: #555;
+}
+
+.apidocs .item .type,
+.apidocs .returns-inline {
+    font-size: 11px;
+    margin: 0 0 0 0;
+}
+
+.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
+.apidocs .item .type a:hover { border: none; }
+
+/* -- Item Parameter List --------------------------------------------------- */
+.apidocs .params-list {
+    list-style: square;
+    margin: 1em 0 0 2em;
+    padding: 0;
+}
+
+.apidocs .param { margin-bottom: 1em; }
+
+.apidocs .param .type,
+.apidocs .param .type a {
+    color: #666;
+}
+
+.apidocs .param .type {
+    margin: 0 0 0 0.5em;
+    *margin-left: 0.5em;
+}
+
+.apidocs .param-name { font-weight: bold; }
+
+/* -- Item "Emits" block ---------------------------------------------------- */
+.apidocs .item .emits {
+    background: #f9f9f9;
+    border-color: #eaeaea;
+}
+
+/* -- Item "Returns" block -------------------------------------------------- */
+.apidocs .item .returns .type,
+.apidocs .item .returns .type a {
+    font-size: 100%;
+    margin: 0;
+}
+
+/* -- Class Constructor block ----------------------------------------------- */
+.apidocs .constructor .item {
+    border: none;
+    padding-bottom: 0;
+}
+
+/* -- File Source View ------------------------------------------------------ */
+.apidocs .file pre.code,
+#doc .apidocs .file pre.prettyprint {
+    background: inherit;
+    border: none;
+    overflow: visible;
+    padding: 0;
+}
+
+.apidocs .L0,
+.apidocs .L1,
+.apidocs .L2,
+.apidocs .L3,
+.apidocs .L4,
+.apidocs .L5,
+.apidocs .L6,
+.apidocs .L7,
+.apidocs .L8,
+.apidocs .L9 {
+    background: inherit;
+}
+
+/* -- Submodule List -------------------------------------------------------- */
+.apidocs .module-submodule-description {
+    font-size: 12px;
+    margin: 0.3em 0 1em;
+}
+
+.apidocs .module-submodule-description p:first-child { margin-top: 0; }
+
+/* -- Sidebar TabView ------------------------------------------------------- */
+#api-tabview { margin-top: 0.6em; }
+
+#api-tabview-filter,
+#api-tabview-panel {
+    border: 1px solid #dfdfdf;
+}
+
+#api-tabview-filter {
+    border-bottom: none;
+    border-top: none;
+    padding: 0.6em 10px 0 10px;
+}
+
+#api-tabview-panel { border-top: none; }
+#api-filter { width: 97%; }
+
+/* -- Content TabView ------------------------------------------------------- */
+#classdocs .yui3-tabview-panel { border: none; }
+
+/* -- Source File Contents -------------------------------------------------- */
+.prettyprint li.L0,
+.prettyprint li.L1,
+.prettyprint li.L2,
+.prettyprint li.L3,
+.prettyprint li.L5,
+.prettyprint li.L6,
+.prettyprint li.L7,
+.prettyprint li.L8 {
+    list-style: decimal;
+}
+
+/* -- API options ----------------------------------------------------------- */
+#api-options {
+    font-size: 11px;
+    margin-top: 2.2em;
+    position: absolute;
+    right: 1.5em;
+}
+
+/*#api-options label { margin-right: 0.6em; }*/
+
+/* -- API list -------------------------------------------------------------- */
+#api-list {
+    margin-top: 1.5em;
+    *zoom: 1;
+}
+
+.apis {
+    font-size: 12px;
+    line-height: 1.4;
+    list-style: none;
+    margin: 0;
+    padding: 0.5em 0 0.5em 0.4em;
+}
+
+.apis a {
+    border: 1px solid transparent;
+    display: block;
+    margin: 0 0 0 -4px;
+    padding: 1px 4px 0;
+    text-decoration: none;
+    _border: none;
+    _display: inline;
+}
+
+.apis a:hover,
+.apis a:focus {
+    background: #E8EDFC;
+    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
+    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
+    border-color: #AAC0FA;
+    border-radius: 3px;
+    color: #333;
+    outline: none;
+}
+
+.api-list-item a:hover,
+.api-list-item a:focus {
+    font-weight: bold;
+    text-shadow: 1px 1px 1px #fff;
+}
+
+.apis .message { color: #888; }
+.apis .result a { padding: 3px 5px 2px; }
+
+.apis .result .type {
+    right: 4px;
+    top: 7px;
+}
+
+.api-list-item .yui3-highlight {
+    font-weight: bold;
+}
+
diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
new file mode 100644
index 0000000..5a95dda
--- /dev/null
+++ b/docs/assets/favicon.png
Binary files differ

diff --git a/README.md b/README.md
index d012149..0dd6b82 100644
--- a/README.md
+++ b/README.md
@@ -14,13 +14,12 @@
 ### Current features ###
 
 - webGL renderer (with automatic smart batching allowing for REALLY fast performance)
-- canvas renderer 
+- canvas renderer
 - full scene graph
-- super easy to use API (similar to the flash display list API)
+- super easy to use API (similar to twhe flash display list API)
 - support for texture atlas's
 - asset loader / sprite sheet loader
 - auto detect which renderer should be used
-- handles device context loss
 
 ### Coming soon ###
 
@@ -48,8 +47,8 @@
 	
 	var stage = new PIXI.Stage;
 
-	var bunnyTexture = new PIXI.Texture("bunny.png");
-	var bunny = new PIXI.Sprite(rabbitTexture);
+	var bunnyTexture = new PIXI.Texture.fromImage("bunny.png");
+	var bunny = new PIXI.Sprite(bunnyTexture);
 	
 	bunny.position.x = 400;
 	bunny.position.y = 300;
diff --git a/bin/pixi.js b/bin/pixi.js
index df5858d..65add09 100644
--- a/bin/pixi.js
+++ b/bin/pixi.js
@@ -1,4 +1,4 @@
-window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)};
+var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)};
 var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a,
 d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j*
 j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b=
@@ -45,7 +45,7 @@
 (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType=
 f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"];
 PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"];
-PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l
    
-  	 
+  	 
   	 
 
-  	 	
+        
       
+        
+      	
         
       	
 		
+
 		
 		
-		
-		
-      	
-      	
 		
+		
+		
+		
+		
+      	
 		
 		
 		
 		
 		
 		
+		
 		
 		
+		
 		
 		
 		
+		
+	
       
  
 	
diff --git a/docs/api.js b/docs/api.js
new file mode 100644
index 0000000..ac07693
--- /dev/null
+++ b/docs/api.js
@@ -0,0 +1,29 @@
+YUI.add("yuidoc-meta", function(Y) {
+   Y.YUIDoc = { meta: {
+    "classes": [
+        "AssetLoader",
+        "BaseTexture",
+        "CanvasRenderer",
+        "DisplayObject",
+        "DisplayObjectContainer",
+        "MovieClip",
+        "Point",
+        "Rectangle",
+        "Sprite",
+        "SpriteSheetLoader",
+        "Stage",
+        "Texture",
+        "WebGLBatch",
+        "WebGLRenderer"
+    ],
+    "modules": [
+        "PIXI"
+    ],
+    "allModules": [
+        {
+            "displayName": "PIXI",
+            "name": "PIXI"
+        }
+    ]
+} };
+});
\ No newline at end of file
diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png
new file mode 100644
index 0000000..759a1cd
--- /dev/null
+++ b/docs/assets/css/external-small.png
Binary files differ
diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png
new file mode 100644
index 0000000..609b336
--- /dev/null
+++ b/docs/assets/css/logo.png
Binary files differ
diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css
new file mode 100644
index 0000000..f8f7ee7
--- /dev/null
+++ b/docs/assets/css/main.css
@@ -0,0 +1,782 @@
+/*
+Font sizes for all selectors other than the body are given in percentages,
+with 100% equal to 13px. To calculate a font size percentage, multiply the
+desired size in pixels by 7.6923076923.
+
+Here's a quick lookup table:
+
+10px - 76.923%
+11px - 84.615%
+12px - 92.308%
+13px - 100%
+14px - 107.692%
+15px - 115.385%
+16px - 123.077%
+17px - 130.769%
+18px - 138.462%
+19px - 146.154%
+20px - 153.846%
+*/
+
+html {
+    background: #fff;
+    color: #333;
+    overflow-y: scroll;
+}
+
+body {
+    font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif;
+    margin: 0;
+    padding: 0;
+}
+
+/* -- Links ----------------------------------------------------------------- */
+a {
+    color: #356de4;
+    text-decoration: none;
+}
+
+.hidden {
+    display: none;
+}
+
+a:hover { text-decoration: underline; }
+
+/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from
+   sight until it's focused. */
+.jump {
+    position: absolute;
+    padding: 3px 6px;
+    left: -99999px;
+    top: 0;
+}
+
+.jump:focus { left: 40%; }
+
+/* -- Paragraphs ------------------------------------------------------------ */
+p { margin: 1.3em 0; }
+dd p, td p { margin-bottom: 0; }
+dd p:first-child, td p:first-child { margin-top: 0; }
+
+/* -- Headings -------------------------------------------------------------- */
+h1, h2, h3, h4, h5, h6 {
+    color: #D98527;/*was #f80*/
+    font-family: 'Trebuchet MS', sans-serif;
+    font-weight: bold;
+    line-height: 1.1;
+    margin: 1.1em 0 0.5em;
+}
+
+h1 {
+    font-size: 184.6%;
+    color: #30418C;
+    margin: 0.75em 0 0.5em;
+}
+
+h2 {
+    font-size: 153.846%;
+    color: #E48A2B;
+}
+
+h3 { font-size: 138.462%; }
+
+h4 {
+    border-bottom: 1px solid #DBDFEA;
+    color: #E48A2B;
+    font-size: 115.385%;
+    font-weight: normal;
+    padding-bottom: 2px;
+}
+
+h5, h6 { font-size: 107.692%; }
+
+/* -- Code and examples ----------------------------------------------------- */
+code, kbd, pre, samp {
+    font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;
+    font-size: 92.308%;
+    line-height: 1.35;
+}
+
+p code, p kbd, p samp {
+    background: #FCFBFA;
+    border: 1px solid #EFEEED;
+    padding: 0 3px;
+}
+
+a code, a kbd, a samp,
+pre code, pre kbd, pre samp,
+table code, table kbd, table samp,
+.intro code, .intro kbd, .intro samp,
+.toc code, .toc kbd, .toc samp {
+    background: none;
+    border: none;
+    padding: 0;
+}
+
+pre.code, pre.terminal, pre.cmd {
+    overflow-x: auto;
+    *overflow-x: scroll;
+    padding: 0.3em 0.6em;
+}
+
+pre.code {
+    background: #FCFBFA;
+    border: 1px solid #EFEEED;
+    border-left-width: 5px;
+}
+
+pre.terminal, pre.cmd {
+    background: #F0EFFC;
+    border: 1px solid #D0CBFB;
+    border-left: 5px solid #D0CBFB;
+}
+
+/* Don't reduce the font size of // elements inside 
+   blocks. */
+pre code, pre kbd, pre samp { font-size: 100%; }
+
+/* Used to denote text that shouldn't be selectable, such as line numbers or
+   shell prompts. Guess which browser this doesn't work in. */
+.noselect {
+    -moz-user-select: -moz-none;
+    -khtml-user-select: none;
+    -webkit-user-select: none;
+    -o-user-select: none;
+    user-select: none;
+}
+
+/* -- Lists ----------------------------------------------------------------- */
+dd { margin: 0.2em 0 0.7em 1em; }
+dl { margin: 1em 0; }
+dt { font-weight: bold; }
+
+/* -- Tables ---------------------------------------------------------------- */
+caption, th { text-align: left; }
+
+table {
+    border-collapse: collapse;
+    width: 100%;
+}
+
+td, th {
+    border: 1px solid #fff;
+    padding: 5px 12px;
+    vertical-align: top;
+}
+
+td { background: #E6E9F5; }
+td dl { margin: 0; }
+td dl dl { margin: 1em 0; }
+td pre:first-child { margin-top: 0; }
+
+th {
+    background: #D2D7E6;/*#97A0BF*/
+    border-bottom: none;
+    border-top: none;
+    color: #000;/*#FFF1D5*/
+    font-family: 'Trebuchet MS', sans-serif;
+    font-weight: bold;
+    line-height: 1.3;
+    white-space: nowrap;
+}
+
+
+/* -- Layout and Content ---------------------------------------------------- */
+#doc {
+    margin: auto;
+    min-width: 1024px;
+}
+
+.content { padding: 0 20px 0 25px; }
+
+.sidebar {
+    padding: 0 15px 0 10px;
+}
+#bd {
+    padding: 7px 0 130px;
+    position: relative;
+    width: 99%;
+}
+
+/* -- Table of Contents ----------------------------------------------------- */
+
+/* The #toc id refers to the single global table of contents, while the .toc
+   class refers to generic TOC lists that could be used throughout the page. */
+
+.toc code, .toc kbd, .toc samp { font-size: 100%; }
+.toc li { font-weight: bold; }
+.toc li li { font-weight: normal; }
+
+/* -- Intro and Example Boxes ----------------------------------------------- */
+/*
+.intro, .example { margin-bottom: 2em; }
+.example {
+    -moz-border-radius: 4px;
+    -webkit-border-radius: 4px;
+    border-radius: 4px;
+    -moz-box-shadow: 0 0 5px #bfbfbf;
+    -webkit-box-shadow: 0 0 5px #bfbfbf;
+    box-shadow: 0 0 5px #bfbfbf;
+    padding: 1em;
+}
+.intro {
+    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
+}
+*/
+
+/* -- Other Styles ---------------------------------------------------------- */
+
+/* These are probably YUI-specific, and should be moved out of Selleck's default
+   theme. */
+
+.button {
+    border: 1px solid #dadada;
+    -moz-border-radius: 3px;
+    -webkit-border-radius: 3px;
+    border-radius: 3px;
+    color: #444;
+    display: inline-block;
+    font-family: Helvetica, Arial, sans-serif;
+    font-size: 92.308%;
+    font-weight: bold;
+    padding: 4px 13px 3px;
+    -moz-text-shadow: 1px 1px 0 #fff;
+    -webkit-text-shadow: 1px 1px 0 #fff;
+    text-shadow: 1px 1px 0 #fff;
+    white-space: nowrap;
+
+    background: #EFEFEF; /* old browsers */
+    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
+    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
+}
+
+.button:hover {
+    border-color: #466899;
+    color: #fff;
+    text-decoration: none;
+    -moz-text-shadow: 1px 1px 0 #222;
+    -webkit-text-shadow: 1px 1px 0 #222;
+    text-shadow: 1px 1px 0 #222;
+
+    background: #6396D8; /* old browsers */
+    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
+    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
+}
+
+.newwindow { text-align: center; }
+
+.header .version em {
+    display: block;
+    text-align: right;
+}
+
+
+#classdocs .item {
+    border-bottom: 1px solid #466899;
+    margin: 1em 0;
+    padding: 1.5em;
+}
+
+#classdocs .item .params p,
+    #classdocs .item .returns p,{
+    display: inline;
+}
+
+#classdocs .item em code, #classdocs .item em.comment {
+    color: green;
+}
+
+#classdocs .item em.comment a {
+    color: green;
+    text-decoration: underline;
+}
+
+#classdocs .foundat {
+    font-size: 11px;
+    font-style: normal;
+}
+
+.attrs .emits {
+    margin-left: 2em;
+    padding: .5em;
+    border-left: 1px dashed #ccc;
+}
+
+abbr {
+    border-bottom: 1px dashed #ccc;
+    font-size: 80%;
+    cursor: help;
+}
+
+.prettyprint li.L0, 
+.prettyprint li.L1, 
+.prettyprint li.L2, 
+.prettyprint li.L3, 
+.prettyprint li.L5, 
+.prettyprint li.L6, 
+.prettyprint li.L7, 
+.prettyprint li.L8 {
+    list-style: decimal;
+}
+
+ul li p {
+    margin-top: 0;
+}
+
+.method .name {
+    font-size: 110%;
+}
+
+.apidocs .methods .extends .method,
+.apidocs .properties .extends .property,
+.apidocs .attrs .extends .attr,
+.apidocs .events .extends .event {
+    font-weight: bold;
+}
+
+.apidocs .methods .extends .inherited,
+.apidocs .properties .extends .inherited,
+.apidocs .attrs .extends .inherited,
+.apidocs .events .extends .inherited {
+    font-weight: normal;
+}
+
+#hd {
+    background: whiteSmoke;
+    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
+    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
+    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
+    border-bottom: 1px solid #DFDFDF;
+    padding: 0 15px 1px 20px;
+    margin-bottom: 15px;
+}
+
+#hd img {
+    margin-right: 10px;
+    vertical-align: middle;
+}
+
+
+/* -- API Docs CSS ---------------------------------------------------------- */
+
+/*
+This file is organized so that more generic styles are nearer the top, and more
+specific styles are nearer the bottom of the file. This allows us to take full
+advantage of the cascade to avoid redundant style rules. Please respect this
+convention when making changes.
+*/
+
+/* -- Generic TabView styles ------------------------------------------------ */
+
+/*
+These styles apply to all API doc tabviews. To change styles only for a
+specific tabview, see the other sections below.
+*/
+
+.yui3-js-enabled .apidocs .tabview {
+    visibility: hidden; /* Hide until the TabView finishes rendering. */
+    _visibility: visible;
+}
+
+.apidocs .tabview.yui3-tabview-content { visibility: visible; }
+.apidocs .tabview .yui3-tabview-panel { background: #fff; }
+
+/* -- Generic Content Styles ------------------------------------------------ */
+
+/* Headings */
+h2, h3, h4, h5, h6 {
+    border: none;
+    color: #30418C;
+    font-weight: bold;
+    text-decoration: none;
+}
+
+.link-docs {
+    float: right;
+    font-size: 15px;
+    margin: 4px 4px 6px;
+    padding: 6px 30px 5px;
+}
+
+.apidocs { zoom: 1; }
+
+/* Generic box styles. */
+.apidocs .box {
+    border: 1px solid;
+    border-radius: 3px;
+    margin: 1em 0;
+    padding: 0 1em;
+}
+
+/* A flag is a compact, capsule-like indicator of some kind. It's used to
+   indicate private and protected items, item return types, etc. in an
+   attractive and unobtrusive way. */
+.apidocs .flag {
+    background: #bababa;
+    border-radius: 3px;
+    color: #fff;
+    font-size: 11px;
+    margin: 0 0.5em;
+    padding: 2px 4px 1px;
+}
+
+/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
+.apidocs .meta {
+    background: #f9f9f9;
+    border-color: #efefef;
+    color: #555;
+    font-size: 11px;
+    padding: 3px 6px;
+}
+
+.apidocs .meta p { margin: 0; }
+
+/* Deprecation warning. */
+.apidocs .box.deprecated,
+.apidocs .flag.deprecated {
+    background: #fdac9f;
+    border: 1px solid #fd7775;
+}
+
+.apidocs .box.deprecated p { margin: 0.5em 0; }
+.apidocs .flag.deprecated { color: #333; }
+
+/* Module/Class intro description. */
+.apidocs .intro {
+    background: #f0f1f8;
+    border-color: #d4d8eb;
+}
+
+/* Loading spinners. */
+#bd.loading .apidocs,
+#api-list.loading .yui3-tabview-panel {
+    background: #fff url(../img/spinner.gif) no-repeat center 70px;
+    min-height: 150px;
+}
+
+#bd.loading .apidocs .content,
+#api-list.loading .yui3-tabview-panel .apis {
+    display: none;
+}
+
+.apidocs .no-visible-items { color: #666; }
+
+/* Generic inline list. */
+.apidocs ul.inline {
+    display: inline;
+    list-style: none;
+    margin: 0;
+    padding: 0;
+}
+
+.apidocs ul.inline li { display: inline; }
+
+/* Comma-separated list. */
+.apidocs ul.commas li:after { content: ','; }
+.apidocs ul.commas li:last-child:after { content: ''; }
+
+/* Keyboard shortcuts. */
+kbd .cmd { font-family: Monaco, Helvetica; }
+
+/* -- Generic Access Level styles ------------------------------------------- */
+.apidocs .item.protected,
+.apidocs .item.private,
+.apidocs .index-item.protected,
+.apidocs .index-item.deprecated,
+.apidocs .index-item.private {
+    display: none;
+}
+
+.show-deprecated .item.deprecated,
+.show-deprecated .index-item.deprecated,
+.show-protected .item.protected,
+.show-protected .index-item.protected,
+.show-private .item.private,
+.show-private .index-item.private {
+    display: block;
+}
+
+.hide-inherited .item.inherited,
+.hide-inherited .index-item.inherited {
+    display: none;
+}
+
+/* -- Generic Item Index styles --------------------------------------------- */
+.apidocs .index { margin: 1.5em 0 3em; }
+
+.apidocs .index h3 {
+    border-bottom: 1px solid #efefef;
+    color: #333;
+    font-size: 13px;
+    margin: 2em 0 0.6em;
+    padding-bottom: 2px;
+}
+
+.apidocs .index .no-visible-items { margin-top: 2em; }
+
+.apidocs .index-list {
+    border-color: #efefef;
+    font-size: 12px;
+    list-style: none;
+    margin: 0;
+    padding: 0;
+    -moz-column-count: 4;
+    -moz-column-gap: 10px;
+    -moz-column-width: 170px;
+    -ms-column-count: 4;
+    -ms-column-gap: 10px;
+    -ms-column-width: 170px;
+    -o-column-count: 4;
+    -o-column-gap: 10px;
+    -o-column-width: 170px;
+    -webkit-column-count: 4;
+    -webkit-column-gap: 10px;
+    -webkit-column-width: 170px;
+    column-count: 4;
+    column-gap: 10px;
+    column-width: 170px;
+}
+
+.apidocs .no-columns .index-list {
+    -moz-column-count: 1;
+    -ms-column-count: 1;
+    -o-column-count: 1;
+    -webkit-column-count: 1;
+    column-count: 1;
+}
+
+.apidocs .index-item { white-space: nowrap; }
+
+.apidocs .index-item .flag {
+    background: none;
+    border: none;
+    color: #afafaf;
+    display: inline;
+    margin: 0 0 0 0.2em;
+    padding: 0;
+}
+
+/* -- Generic API item styles ----------------------------------------------- */
+.apidocs .args {
+    display: inline;
+    margin: 0 0.5em;
+}
+
+.apidocs .flag.chainable { background: #46ca3b; }
+.apidocs .flag.protected { background: #9b86fc; }
+.apidocs .flag.private { background: #fd6b1b; }
+.apidocs .flag.async { background: #356de4; }
+.apidocs .flag.required { background: #e60923; }
+
+.apidocs .item {
+    border-bottom: 1px solid #efefef;
+    margin: 1.5em 0 2em;
+    padding-bottom: 2em;
+}
+
+.apidocs .item h4,
+.apidocs .item h5,
+.apidocs .item h6 {
+    color: #333;
+    font-family: inherit;
+    font-size: 100%;
+}
+
+.apidocs .item .description p,
+.apidocs .item pre.code {
+    margin: 1em 0 0;
+}
+
+.apidocs .item .meta {
+    background: none;
+    border: none;
+    padding: 0;
+}
+
+.apidocs .item .name {
+    display: inline;
+    font-size: 14px;
+}
+
+.apidocs .item .type,
+.apidocs .item .type a,
+.apidocs .returns-inline {
+    color: #555;
+}
+
+.apidocs .item .type,
+.apidocs .returns-inline {
+    font-size: 11px;
+    margin: 0 0 0 0;
+}
+
+.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
+.apidocs .item .type a:hover { border: none; }
+
+/* -- Item Parameter List --------------------------------------------------- */
+.apidocs .params-list {
+    list-style: square;
+    margin: 1em 0 0 2em;
+    padding: 0;
+}
+
+.apidocs .param { margin-bottom: 1em; }
+
+.apidocs .param .type,
+.apidocs .param .type a {
+    color: #666;
+}
+
+.apidocs .param .type {
+    margin: 0 0 0 0.5em;
+    *margin-left: 0.5em;
+}
+
+.apidocs .param-name { font-weight: bold; }
+
+/* -- Item "Emits" block ---------------------------------------------------- */
+.apidocs .item .emits {
+    background: #f9f9f9;
+    border-color: #eaeaea;
+}
+
+/* -- Item "Returns" block -------------------------------------------------- */
+.apidocs .item .returns .type,
+.apidocs .item .returns .type a {
+    font-size: 100%;
+    margin: 0;
+}
+
+/* -- Class Constructor block ----------------------------------------------- */
+.apidocs .constructor .item {
+    border: none;
+    padding-bottom: 0;
+}
+
+/* -- File Source View ------------------------------------------------------ */
+.apidocs .file pre.code,
+#doc .apidocs .file pre.prettyprint {
+    background: inherit;
+    border: none;
+    overflow: visible;
+    padding: 0;
+}
+
+.apidocs .L0,
+.apidocs .L1,
+.apidocs .L2,
+.apidocs .L3,
+.apidocs .L4,
+.apidocs .L5,
+.apidocs .L6,
+.apidocs .L7,
+.apidocs .L8,
+.apidocs .L9 {
+    background: inherit;
+}
+
+/* -- Submodule List -------------------------------------------------------- */
+.apidocs .module-submodule-description {
+    font-size: 12px;
+    margin: 0.3em 0 1em;
+}
+
+.apidocs .module-submodule-description p:first-child { margin-top: 0; }
+
+/* -- Sidebar TabView ------------------------------------------------------- */
+#api-tabview { margin-top: 0.6em; }
+
+#api-tabview-filter,
+#api-tabview-panel {
+    border: 1px solid #dfdfdf;
+}
+
+#api-tabview-filter {
+    border-bottom: none;
+    border-top: none;
+    padding: 0.6em 10px 0 10px;
+}
+
+#api-tabview-panel { border-top: none; }
+#api-filter { width: 97%; }
+
+/* -- Content TabView ------------------------------------------------------- */
+#classdocs .yui3-tabview-panel { border: none; }
+
+/* -- Source File Contents -------------------------------------------------- */
+.prettyprint li.L0,
+.prettyprint li.L1,
+.prettyprint li.L2,
+.prettyprint li.L3,
+.prettyprint li.L5,
+.prettyprint li.L6,
+.prettyprint li.L7,
+.prettyprint li.L8 {
+    list-style: decimal;
+}
+
+/* -- API options ----------------------------------------------------------- */
+#api-options {
+    font-size: 11px;
+    margin-top: 2.2em;
+    position: absolute;
+    right: 1.5em;
+}
+
+/*#api-options label { margin-right: 0.6em; }*/
+
+/* -- API list -------------------------------------------------------------- */
+#api-list {
+    margin-top: 1.5em;
+    *zoom: 1;
+}
+
+.apis {
+    font-size: 12px;
+    line-height: 1.4;
+    list-style: none;
+    margin: 0;
+    padding: 0.5em 0 0.5em 0.4em;
+}
+
+.apis a {
+    border: 1px solid transparent;
+    display: block;
+    margin: 0 0 0 -4px;
+    padding: 1px 4px 0;
+    text-decoration: none;
+    _border: none;
+    _display: inline;
+}
+
+.apis a:hover,
+.apis a:focus {
+    background: #E8EDFC;
+    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
+    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
+    border-color: #AAC0FA;
+    border-radius: 3px;
+    color: #333;
+    outline: none;
+}
+
+.api-list-item a:hover,
+.api-list-item a:focus {
+    font-weight: bold;
+    text-shadow: 1px 1px 1px #fff;
+}
+
+.apis .message { color: #888; }
+.apis .result a { padding: 3px 5px 2px; }
+
+.apis .result .type {
+    right: 4px;
+    top: 7px;
+}
+
+.api-list-item .yui3-highlight {
+    font-weight: bold;
+}
+
diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
new file mode 100644
index 0000000..5a95dda
--- /dev/null
+++ b/docs/assets/favicon.png
Binary files differ
diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
new file mode 100644
index 0000000..44f96ba
--- /dev/null
+++ b/docs/assets/img/spinner.gif
Binary files differ

diff --git a/README.md b/README.md
index d012149..0dd6b82 100644
--- a/README.md
+++ b/README.md
@@ -14,13 +14,12 @@
 ### Current features ###
 
 - webGL renderer (with automatic smart batching allowing for REALLY fast performance)
-- canvas renderer 
+- canvas renderer
 - full scene graph
-- super easy to use API (similar to the flash display list API)
+- super easy to use API (similar to twhe flash display list API)
 - support for texture atlas's
 - asset loader / sprite sheet loader
 - auto detect which renderer should be used
-- handles device context loss
 
 ### Coming soon ###
 
@@ -48,8 +47,8 @@
 	
 	var stage = new PIXI.Stage;
 
-	var bunnyTexture = new PIXI.Texture("bunny.png");
-	var bunny = new PIXI.Sprite(rabbitTexture);
+	var bunnyTexture = new PIXI.Texture.fromImage("bunny.png");
+	var bunny = new PIXI.Sprite(bunnyTexture);
 	
 	bunny.position.x = 400;
 	bunny.position.y = 300;
diff --git a/bin/pixi.js b/bin/pixi.js
index df5858d..65add09 100644
--- a/bin/pixi.js
+++ b/bin/pixi.js
@@ -1,4 +1,4 @@
-window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)};
+var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)};
 var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a,
 d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j*
 j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b=
@@ -45,7 +45,7 @@
 (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType=
 f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"];
 PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"];
-PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l
    
-  	 
+  	 
   	 
 
-  	 	
+        
       
+        
+      	
         
       	
 		
+
 		
 		
-		
-		
-      	
-      	
 		
+		
+		
+		
+		
+      	
 		
 		
 		
 		
 		
 		
+		
 		
 		
+		
 		
 		
 		
+		
+	
       
  
 	
diff --git a/docs/api.js b/docs/api.js
new file mode 100644
index 0000000..ac07693
--- /dev/null
+++ b/docs/api.js
@@ -0,0 +1,29 @@
+YUI.add("yuidoc-meta", function(Y) {
+   Y.YUIDoc = { meta: {
+    "classes": [
+        "AssetLoader",
+        "BaseTexture",
+        "CanvasRenderer",
+        "DisplayObject",
+        "DisplayObjectContainer",
+        "MovieClip",
+        "Point",
+        "Rectangle",
+        "Sprite",
+        "SpriteSheetLoader",
+        "Stage",
+        "Texture",
+        "WebGLBatch",
+        "WebGLRenderer"
+    ],
+    "modules": [
+        "PIXI"
+    ],
+    "allModules": [
+        {
+            "displayName": "PIXI",
+            "name": "PIXI"
+        }
+    ]
+} };
+});
\ No newline at end of file
diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png
new file mode 100644
index 0000000..759a1cd
--- /dev/null
+++ b/docs/assets/css/external-small.png
Binary files differ
diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png
new file mode 100644
index 0000000..609b336
--- /dev/null
+++ b/docs/assets/css/logo.png
Binary files differ
diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css
new file mode 100644
index 0000000..f8f7ee7
--- /dev/null
+++ b/docs/assets/css/main.css
@@ -0,0 +1,782 @@
+/*
+Font sizes for all selectors other than the body are given in percentages,
+with 100% equal to 13px. To calculate a font size percentage, multiply the
+desired size in pixels by 7.6923076923.
+
+Here's a quick lookup table:
+
+10px - 76.923%
+11px - 84.615%
+12px - 92.308%
+13px - 100%
+14px - 107.692%
+15px - 115.385%
+16px - 123.077%
+17px - 130.769%
+18px - 138.462%
+19px - 146.154%
+20px - 153.846%
+*/
+
+html {
+    background: #fff;
+    color: #333;
+    overflow-y: scroll;
+}
+
+body {
+    font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif;
+    margin: 0;
+    padding: 0;
+}
+
+/* -- Links ----------------------------------------------------------------- */
+a {
+    color: #356de4;
+    text-decoration: none;
+}
+
+.hidden {
+    display: none;
+}
+
+a:hover { text-decoration: underline; }
+
+/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from
+   sight until it's focused. */
+.jump {
+    position: absolute;
+    padding: 3px 6px;
+    left: -99999px;
+    top: 0;
+}
+
+.jump:focus { left: 40%; }
+
+/* -- Paragraphs ------------------------------------------------------------ */
+p { margin: 1.3em 0; }
+dd p, td p { margin-bottom: 0; }
+dd p:first-child, td p:first-child { margin-top: 0; }
+
+/* -- Headings -------------------------------------------------------------- */
+h1, h2, h3, h4, h5, h6 {
+    color: #D98527;/*was #f80*/
+    font-family: 'Trebuchet MS', sans-serif;
+    font-weight: bold;
+    line-height: 1.1;
+    margin: 1.1em 0 0.5em;
+}
+
+h1 {
+    font-size: 184.6%;
+    color: #30418C;
+    margin: 0.75em 0 0.5em;
+}
+
+h2 {
+    font-size: 153.846%;
+    color: #E48A2B;
+}
+
+h3 { font-size: 138.462%; }
+
+h4 {
+    border-bottom: 1px solid #DBDFEA;
+    color: #E48A2B;
+    font-size: 115.385%;
+    font-weight: normal;
+    padding-bottom: 2px;
+}
+
+h5, h6 { font-size: 107.692%; }
+
+/* -- Code and examples ----------------------------------------------------- */
+code, kbd, pre, samp {
+    font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;
+    font-size: 92.308%;
+    line-height: 1.35;
+}
+
+p code, p kbd, p samp {
+    background: #FCFBFA;
+    border: 1px solid #EFEEED;
+    padding: 0 3px;
+}
+
+a code, a kbd, a samp,
+pre code, pre kbd, pre samp,
+table code, table kbd, table samp,
+.intro code, .intro kbd, .intro samp,
+.toc code, .toc kbd, .toc samp {
+    background: none;
+    border: none;
+    padding: 0;
+}
+
+pre.code, pre.terminal, pre.cmd {
+    overflow-x: auto;
+    *overflow-x: scroll;
+    padding: 0.3em 0.6em;
+}
+
+pre.code {
+    background: #FCFBFA;
+    border: 1px solid #EFEEED;
+    border-left-width: 5px;
+}
+
+pre.terminal, pre.cmd {
+    background: #F0EFFC;
+    border: 1px solid #D0CBFB;
+    border-left: 5px solid #D0CBFB;
+}
+
+/* Don't reduce the font size of // elements inside 
+   blocks. */
+pre code, pre kbd, pre samp { font-size: 100%; }
+
+/* Used to denote text that shouldn't be selectable, such as line numbers or
+   shell prompts. Guess which browser this doesn't work in. */
+.noselect {
+    -moz-user-select: -moz-none;
+    -khtml-user-select: none;
+    -webkit-user-select: none;
+    -o-user-select: none;
+    user-select: none;
+}
+
+/* -- Lists ----------------------------------------------------------------- */
+dd { margin: 0.2em 0 0.7em 1em; }
+dl { margin: 1em 0; }
+dt { font-weight: bold; }
+
+/* -- Tables ---------------------------------------------------------------- */
+caption, th { text-align: left; }
+
+table {
+    border-collapse: collapse;
+    width: 100%;
+}
+
+td, th {
+    border: 1px solid #fff;
+    padding: 5px 12px;
+    vertical-align: top;
+}
+
+td { background: #E6E9F5; }
+td dl { margin: 0; }
+td dl dl { margin: 1em 0; }
+td pre:first-child { margin-top: 0; }
+
+th {
+    background: #D2D7E6;/*#97A0BF*/
+    border-bottom: none;
+    border-top: none;
+    color: #000;/*#FFF1D5*/
+    font-family: 'Trebuchet MS', sans-serif;
+    font-weight: bold;
+    line-height: 1.3;
+    white-space: nowrap;
+}
+
+
+/* -- Layout and Content ---------------------------------------------------- */
+#doc {
+    margin: auto;
+    min-width: 1024px;
+}
+
+.content { padding: 0 20px 0 25px; }
+
+.sidebar {
+    padding: 0 15px 0 10px;
+}
+#bd {
+    padding: 7px 0 130px;
+    position: relative;
+    width: 99%;
+}
+
+/* -- Table of Contents ----------------------------------------------------- */
+
+/* The #toc id refers to the single global table of contents, while the .toc
+   class refers to generic TOC lists that could be used throughout the page. */
+
+.toc code, .toc kbd, .toc samp { font-size: 100%; }
+.toc li { font-weight: bold; }
+.toc li li { font-weight: normal; }
+
+/* -- Intro and Example Boxes ----------------------------------------------- */
+/*
+.intro, .example { margin-bottom: 2em; }
+.example {
+    -moz-border-radius: 4px;
+    -webkit-border-radius: 4px;
+    border-radius: 4px;
+    -moz-box-shadow: 0 0 5px #bfbfbf;
+    -webkit-box-shadow: 0 0 5px #bfbfbf;
+    box-shadow: 0 0 5px #bfbfbf;
+    padding: 1em;
+}
+.intro {
+    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
+}
+*/
+
+/* -- Other Styles ---------------------------------------------------------- */
+
+/* These are probably YUI-specific, and should be moved out of Selleck's default
+   theme. */
+
+.button {
+    border: 1px solid #dadada;
+    -moz-border-radius: 3px;
+    -webkit-border-radius: 3px;
+    border-radius: 3px;
+    color: #444;
+    display: inline-block;
+    font-family: Helvetica, Arial, sans-serif;
+    font-size: 92.308%;
+    font-weight: bold;
+    padding: 4px 13px 3px;
+    -moz-text-shadow: 1px 1px 0 #fff;
+    -webkit-text-shadow: 1px 1px 0 #fff;
+    text-shadow: 1px 1px 0 #fff;
+    white-space: nowrap;
+
+    background: #EFEFEF; /* old browsers */
+    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
+    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
+}
+
+.button:hover {
+    border-color: #466899;
+    color: #fff;
+    text-decoration: none;
+    -moz-text-shadow: 1px 1px 0 #222;
+    -webkit-text-shadow: 1px 1px 0 #222;
+    text-shadow: 1px 1px 0 #222;
+
+    background: #6396D8; /* old browsers */
+    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
+    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
+}
+
+.newwindow { text-align: center; }
+
+.header .version em {
+    display: block;
+    text-align: right;
+}
+
+
+#classdocs .item {
+    border-bottom: 1px solid #466899;
+    margin: 1em 0;
+    padding: 1.5em;
+}
+
+#classdocs .item .params p,
+    #classdocs .item .returns p,{
+    display: inline;
+}
+
+#classdocs .item em code, #classdocs .item em.comment {
+    color: green;
+}
+
+#classdocs .item em.comment a {
+    color: green;
+    text-decoration: underline;
+}
+
+#classdocs .foundat {
+    font-size: 11px;
+    font-style: normal;
+}
+
+.attrs .emits {
+    margin-left: 2em;
+    padding: .5em;
+    border-left: 1px dashed #ccc;
+}
+
+abbr {
+    border-bottom: 1px dashed #ccc;
+    font-size: 80%;
+    cursor: help;
+}
+
+.prettyprint li.L0, 
+.prettyprint li.L1, 
+.prettyprint li.L2, 
+.prettyprint li.L3, 
+.prettyprint li.L5, 
+.prettyprint li.L6, 
+.prettyprint li.L7, 
+.prettyprint li.L8 {
+    list-style: decimal;
+}
+
+ul li p {
+    margin-top: 0;
+}
+
+.method .name {
+    font-size: 110%;
+}
+
+.apidocs .methods .extends .method,
+.apidocs .properties .extends .property,
+.apidocs .attrs .extends .attr,
+.apidocs .events .extends .event {
+    font-weight: bold;
+}
+
+.apidocs .methods .extends .inherited,
+.apidocs .properties .extends .inherited,
+.apidocs .attrs .extends .inherited,
+.apidocs .events .extends .inherited {
+    font-weight: normal;
+}
+
+#hd {
+    background: whiteSmoke;
+    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
+    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
+    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
+    border-bottom: 1px solid #DFDFDF;
+    padding: 0 15px 1px 20px;
+    margin-bottom: 15px;
+}
+
+#hd img {
+    margin-right: 10px;
+    vertical-align: middle;
+}
+
+
+/* -- API Docs CSS ---------------------------------------------------------- */
+
+/*
+This file is organized so that more generic styles are nearer the top, and more
+specific styles are nearer the bottom of the file. This allows us to take full
+advantage of the cascade to avoid redundant style rules. Please respect this
+convention when making changes.
+*/
+
+/* -- Generic TabView styles ------------------------------------------------ */
+
+/*
+These styles apply to all API doc tabviews. To change styles only for a
+specific tabview, see the other sections below.
+*/
+
+.yui3-js-enabled .apidocs .tabview {
+    visibility: hidden; /* Hide until the TabView finishes rendering. */
+    _visibility: visible;
+}
+
+.apidocs .tabview.yui3-tabview-content { visibility: visible; }
+.apidocs .tabview .yui3-tabview-panel { background: #fff; }
+
+/* -- Generic Content Styles ------------------------------------------------ */
+
+/* Headings */
+h2, h3, h4, h5, h6 {
+    border: none;
+    color: #30418C;
+    font-weight: bold;
+    text-decoration: none;
+}
+
+.link-docs {
+    float: right;
+    font-size: 15px;
+    margin: 4px 4px 6px;
+    padding: 6px 30px 5px;
+}
+
+.apidocs { zoom: 1; }
+
+/* Generic box styles. */
+.apidocs .box {
+    border: 1px solid;
+    border-radius: 3px;
+    margin: 1em 0;
+    padding: 0 1em;
+}
+
+/* A flag is a compact, capsule-like indicator of some kind. It's used to
+   indicate private and protected items, item return types, etc. in an
+   attractive and unobtrusive way. */
+.apidocs .flag {
+    background: #bababa;
+    border-radius: 3px;
+    color: #fff;
+    font-size: 11px;
+    margin: 0 0.5em;
+    padding: 2px 4px 1px;
+}
+
+/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
+.apidocs .meta {
+    background: #f9f9f9;
+    border-color: #efefef;
+    color: #555;
+    font-size: 11px;
+    padding: 3px 6px;
+}
+
+.apidocs .meta p { margin: 0; }
+
+/* Deprecation warning. */
+.apidocs .box.deprecated,
+.apidocs .flag.deprecated {
+    background: #fdac9f;
+    border: 1px solid #fd7775;
+}
+
+.apidocs .box.deprecated p { margin: 0.5em 0; }
+.apidocs .flag.deprecated { color: #333; }
+
+/* Module/Class intro description. */
+.apidocs .intro {
+    background: #f0f1f8;
+    border-color: #d4d8eb;
+}
+
+/* Loading spinners. */
+#bd.loading .apidocs,
+#api-list.loading .yui3-tabview-panel {
+    background: #fff url(../img/spinner.gif) no-repeat center 70px;
+    min-height: 150px;
+}
+
+#bd.loading .apidocs .content,
+#api-list.loading .yui3-tabview-panel .apis {
+    display: none;
+}
+
+.apidocs .no-visible-items { color: #666; }
+
+/* Generic inline list. */
+.apidocs ul.inline {
+    display: inline;
+    list-style: none;
+    margin: 0;
+    padding: 0;
+}
+
+.apidocs ul.inline li { display: inline; }
+
+/* Comma-separated list. */
+.apidocs ul.commas li:after { content: ','; }
+.apidocs ul.commas li:last-child:after { content: ''; }
+
+/* Keyboard shortcuts. */
+kbd .cmd { font-family: Monaco, Helvetica; }
+
+/* -- Generic Access Level styles ------------------------------------------- */
+.apidocs .item.protected,
+.apidocs .item.private,
+.apidocs .index-item.protected,
+.apidocs .index-item.deprecated,
+.apidocs .index-item.private {
+    display: none;
+}
+
+.show-deprecated .item.deprecated,
+.show-deprecated .index-item.deprecated,
+.show-protected .item.protected,
+.show-protected .index-item.protected,
+.show-private .item.private,
+.show-private .index-item.private {
+    display: block;
+}
+
+.hide-inherited .item.inherited,
+.hide-inherited .index-item.inherited {
+    display: none;
+}
+
+/* -- Generic Item Index styles --------------------------------------------- */
+.apidocs .index { margin: 1.5em 0 3em; }
+
+.apidocs .index h3 {
+    border-bottom: 1px solid #efefef;
+    color: #333;
+    font-size: 13px;
+    margin: 2em 0 0.6em;
+    padding-bottom: 2px;
+}
+
+.apidocs .index .no-visible-items { margin-top: 2em; }
+
+.apidocs .index-list {
+    border-color: #efefef;
+    font-size: 12px;
+    list-style: none;
+    margin: 0;
+    padding: 0;
+    -moz-column-count: 4;
+    -moz-column-gap: 10px;
+    -moz-column-width: 170px;
+    -ms-column-count: 4;
+    -ms-column-gap: 10px;
+    -ms-column-width: 170px;
+    -o-column-count: 4;
+    -o-column-gap: 10px;
+    -o-column-width: 170px;
+    -webkit-column-count: 4;
+    -webkit-column-gap: 10px;
+    -webkit-column-width: 170px;
+    column-count: 4;
+    column-gap: 10px;
+    column-width: 170px;
+}
+
+.apidocs .no-columns .index-list {
+    -moz-column-count: 1;
+    -ms-column-count: 1;
+    -o-column-count: 1;
+    -webkit-column-count: 1;
+    column-count: 1;
+}
+
+.apidocs .index-item { white-space: nowrap; }
+
+.apidocs .index-item .flag {
+    background: none;
+    border: none;
+    color: #afafaf;
+    display: inline;
+    margin: 0 0 0 0.2em;
+    padding: 0;
+}
+
+/* -- Generic API item styles ----------------------------------------------- */
+.apidocs .args {
+    display: inline;
+    margin: 0 0.5em;
+}
+
+.apidocs .flag.chainable { background: #46ca3b; }
+.apidocs .flag.protected { background: #9b86fc; }
+.apidocs .flag.private { background: #fd6b1b; }
+.apidocs .flag.async { background: #356de4; }
+.apidocs .flag.required { background: #e60923; }
+
+.apidocs .item {
+    border-bottom: 1px solid #efefef;
+    margin: 1.5em 0 2em;
+    padding-bottom: 2em;
+}
+
+.apidocs .item h4,
+.apidocs .item h5,
+.apidocs .item h6 {
+    color: #333;
+    font-family: inherit;
+    font-size: 100%;
+}
+
+.apidocs .item .description p,
+.apidocs .item pre.code {
+    margin: 1em 0 0;
+}
+
+.apidocs .item .meta {
+    background: none;
+    border: none;
+    padding: 0;
+}
+
+.apidocs .item .name {
+    display: inline;
+    font-size: 14px;
+}
+
+.apidocs .item .type,
+.apidocs .item .type a,
+.apidocs .returns-inline {
+    color: #555;
+}
+
+.apidocs .item .type,
+.apidocs .returns-inline {
+    font-size: 11px;
+    margin: 0 0 0 0;
+}
+
+.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
+.apidocs .item .type a:hover { border: none; }
+
+/* -- Item Parameter List --------------------------------------------------- */
+.apidocs .params-list {
+    list-style: square;
+    margin: 1em 0 0 2em;
+    padding: 0;
+}
+
+.apidocs .param { margin-bottom: 1em; }
+
+.apidocs .param .type,
+.apidocs .param .type a {
+    color: #666;
+}
+
+.apidocs .param .type {
+    margin: 0 0 0 0.5em;
+    *margin-left: 0.5em;
+}
+
+.apidocs .param-name { font-weight: bold; }
+
+/* -- Item "Emits" block ---------------------------------------------------- */
+.apidocs .item .emits {
+    background: #f9f9f9;
+    border-color: #eaeaea;
+}
+
+/* -- Item "Returns" block -------------------------------------------------- */
+.apidocs .item .returns .type,
+.apidocs .item .returns .type a {
+    font-size: 100%;
+    margin: 0;
+}
+
+/* -- Class Constructor block ----------------------------------------------- */
+.apidocs .constructor .item {
+    border: none;
+    padding-bottom: 0;
+}
+
+/* -- File Source View ------------------------------------------------------ */
+.apidocs .file pre.code,
+#doc .apidocs .file pre.prettyprint {
+    background: inherit;
+    border: none;
+    overflow: visible;
+    padding: 0;
+}
+
+.apidocs .L0,
+.apidocs .L1,
+.apidocs .L2,
+.apidocs .L3,
+.apidocs .L4,
+.apidocs .L5,
+.apidocs .L6,
+.apidocs .L7,
+.apidocs .L8,
+.apidocs .L9 {
+    background: inherit;
+}
+
+/* -- Submodule List -------------------------------------------------------- */
+.apidocs .module-submodule-description {
+    font-size: 12px;
+    margin: 0.3em 0 1em;
+}
+
+.apidocs .module-submodule-description p:first-child { margin-top: 0; }
+
+/* -- Sidebar TabView ------------------------------------------------------- */
+#api-tabview { margin-top: 0.6em; }
+
+#api-tabview-filter,
+#api-tabview-panel {
+    border: 1px solid #dfdfdf;
+}
+
+#api-tabview-filter {
+    border-bottom: none;
+    border-top: none;
+    padding: 0.6em 10px 0 10px;
+}
+
+#api-tabview-panel { border-top: none; }
+#api-filter { width: 97%; }
+
+/* -- Content TabView ------------------------------------------------------- */
+#classdocs .yui3-tabview-panel { border: none; }
+
+/* -- Source File Contents -------------------------------------------------- */
+.prettyprint li.L0,
+.prettyprint li.L1,
+.prettyprint li.L2,
+.prettyprint li.L3,
+.prettyprint li.L5,
+.prettyprint li.L6,
+.prettyprint li.L7,
+.prettyprint li.L8 {
+    list-style: decimal;
+}
+
+/* -- API options ----------------------------------------------------------- */
+#api-options {
+    font-size: 11px;
+    margin-top: 2.2em;
+    position: absolute;
+    right: 1.5em;
+}
+
+/*#api-options label { margin-right: 0.6em; }*/
+
+/* -- API list -------------------------------------------------------------- */
+#api-list {
+    margin-top: 1.5em;
+    *zoom: 1;
+}
+
+.apis {
+    font-size: 12px;
+    line-height: 1.4;
+    list-style: none;
+    margin: 0;
+    padding: 0.5em 0 0.5em 0.4em;
+}
+
+.apis a {
+    border: 1px solid transparent;
+    display: block;
+    margin: 0 0 0 -4px;
+    padding: 1px 4px 0;
+    text-decoration: none;
+    _border: none;
+    _display: inline;
+}
+
+.apis a:hover,
+.apis a:focus {
+    background: #E8EDFC;
+    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
+    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
+    border-color: #AAC0FA;
+    border-radius: 3px;
+    color: #333;
+    outline: none;
+}
+
+.api-list-item a:hover,
+.api-list-item a:focus {
+    font-weight: bold;
+    text-shadow: 1px 1px 1px #fff;
+}
+
+.apis .message { color: #888; }
+.apis .result a { padding: 3px 5px 2px; }
+
+.apis .result .type {
+    right: 4px;
+    top: 7px;
+}
+
+.api-list-item .yui3-highlight {
+    font-weight: bold;
+}
+
diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
new file mode 100644
index 0000000..5a95dda
--- /dev/null
+++ b/docs/assets/favicon.png
Binary files differ
diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
new file mode 100644
index 0000000..44f96ba
--- /dev/null
+++ b/docs/assets/img/spinner.gif
Binary files differ
diff --git a/docs/assets/index.html b/docs/assets/index.html
new file mode 100644
index 0000000..487fe15
--- /dev/null
+++ b/docs/assets/index.html
@@ -0,0 +1,10 @@
+
+
+    
+        Redirector
+        
+    
+    
+        Click here to redirect
+    
+

diff --git a/README.md b/README.md
index d012149..0dd6b82 100644
--- a/README.md
+++ b/README.md
@@ -14,13 +14,12 @@
 ### Current features ###
 
 - webGL renderer (with automatic smart batching allowing for REALLY fast performance)
-- canvas renderer 
+- canvas renderer
 - full scene graph
-- super easy to use API (similar to the flash display list API)
+- super easy to use API (similar to twhe flash display list API)
 - support for texture atlas's
 - asset loader / sprite sheet loader
 - auto detect which renderer should be used
-- handles device context loss
 
 ### Coming soon ###
 
@@ -48,8 +47,8 @@
 	
 	var stage = new PIXI.Stage;
 
-	var bunnyTexture = new PIXI.Texture("bunny.png");
-	var bunny = new PIXI.Sprite(rabbitTexture);
+	var bunnyTexture = new PIXI.Texture.fromImage("bunny.png");
+	var bunny = new PIXI.Sprite(bunnyTexture);
 	
 	bunny.position.x = 400;
 	bunny.position.y = 300;
diff --git a/bin/pixi.js b/bin/pixi.js
index df5858d..65add09 100644
--- a/bin/pixi.js
+++ b/bin/pixi.js
@@ -1,4 +1,4 @@
-window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)};
+var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)};
 var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a,
 d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j*
 j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b=
@@ -45,7 +45,7 @@
 (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType=
 f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"];
 PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"];
-PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l
    
-  	 
+  	 
   	 
 
-  	 	
+        
       
+        
+      	
         
       	
 		
+
 		
 		
-		
-		
-      	
-      	
 		
+		
+		
+		
+		
+      	
 		
 		
 		
 		
 		
 		
+		
 		
 		
+		
 		
 		
 		
+		
+	
       
  
 	
diff --git a/docs/api.js b/docs/api.js
new file mode 100644
index 0000000..ac07693
--- /dev/null
+++ b/docs/api.js
@@ -0,0 +1,29 @@
+YUI.add("yuidoc-meta", function(Y) {
+   Y.YUIDoc = { meta: {
+    "classes": [
+        "AssetLoader",
+        "BaseTexture",
+        "CanvasRenderer",
+        "DisplayObject",
+        "DisplayObjectContainer",
+        "MovieClip",
+        "Point",
+        "Rectangle",
+        "Sprite",
+        "SpriteSheetLoader",
+        "Stage",
+        "Texture",
+        "WebGLBatch",
+        "WebGLRenderer"
+    ],
+    "modules": [
+        "PIXI"
+    ],
+    "allModules": [
+        {
+            "displayName": "PIXI",
+            "name": "PIXI"
+        }
+    ]
+} };
+});
\ No newline at end of file
diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png
new file mode 100644
index 0000000..759a1cd
--- /dev/null
+++ b/docs/assets/css/external-small.png
Binary files differ
diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png
new file mode 100644
index 0000000..609b336
--- /dev/null
+++ b/docs/assets/css/logo.png
Binary files differ
diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css
new file mode 100644
index 0000000..f8f7ee7
--- /dev/null
+++ b/docs/assets/css/main.css
@@ -0,0 +1,782 @@
+/*
+Font sizes for all selectors other than the body are given in percentages,
+with 100% equal to 13px. To calculate a font size percentage, multiply the
+desired size in pixels by 7.6923076923.
+
+Here's a quick lookup table:
+
+10px - 76.923%
+11px - 84.615%
+12px - 92.308%
+13px - 100%
+14px - 107.692%
+15px - 115.385%
+16px - 123.077%
+17px - 130.769%
+18px - 138.462%
+19px - 146.154%
+20px - 153.846%
+*/
+
+html {
+    background: #fff;
+    color: #333;
+    overflow-y: scroll;
+}
+
+body {
+    font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif;
+    margin: 0;
+    padding: 0;
+}
+
+/* -- Links ----------------------------------------------------------------- */
+a {
+    color: #356de4;
+    text-decoration: none;
+}
+
+.hidden {
+    display: none;
+}
+
+a:hover { text-decoration: underline; }
+
+/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from
+   sight until it's focused. */
+.jump {
+    position: absolute;
+    padding: 3px 6px;
+    left: -99999px;
+    top: 0;
+}
+
+.jump:focus { left: 40%; }
+
+/* -- Paragraphs ------------------------------------------------------------ */
+p { margin: 1.3em 0; }
+dd p, td p { margin-bottom: 0; }
+dd p:first-child, td p:first-child { margin-top: 0; }
+
+/* -- Headings -------------------------------------------------------------- */
+h1, h2, h3, h4, h5, h6 {
+    color: #D98527;/*was #f80*/
+    font-family: 'Trebuchet MS', sans-serif;
+    font-weight: bold;
+    line-height: 1.1;
+    margin: 1.1em 0 0.5em;
+}
+
+h1 {
+    font-size: 184.6%;
+    color: #30418C;
+    margin: 0.75em 0 0.5em;
+}
+
+h2 {
+    font-size: 153.846%;
+    color: #E48A2B;
+}
+
+h3 { font-size: 138.462%; }
+
+h4 {
+    border-bottom: 1px solid #DBDFEA;
+    color: #E48A2B;
+    font-size: 115.385%;
+    font-weight: normal;
+    padding-bottom: 2px;
+}
+
+h5, h6 { font-size: 107.692%; }
+
+/* -- Code and examples ----------------------------------------------------- */
+code, kbd, pre, samp {
+    font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;
+    font-size: 92.308%;
+    line-height: 1.35;
+}
+
+p code, p kbd, p samp {
+    background: #FCFBFA;
+    border: 1px solid #EFEEED;
+    padding: 0 3px;
+}
+
+a code, a kbd, a samp,
+pre code, pre kbd, pre samp,
+table code, table kbd, table samp,
+.intro code, .intro kbd, .intro samp,
+.toc code, .toc kbd, .toc samp {
+    background: none;
+    border: none;
+    padding: 0;
+}
+
+pre.code, pre.terminal, pre.cmd {
+    overflow-x: auto;
+    *overflow-x: scroll;
+    padding: 0.3em 0.6em;
+}
+
+pre.code {
+    background: #FCFBFA;
+    border: 1px solid #EFEEED;
+    border-left-width: 5px;
+}
+
+pre.terminal, pre.cmd {
+    background: #F0EFFC;
+    border: 1px solid #D0CBFB;
+    border-left: 5px solid #D0CBFB;
+}
+
+/* Don't reduce the font size of // elements inside 
+   blocks. */
+pre code, pre kbd, pre samp { font-size: 100%; }
+
+/* Used to denote text that shouldn't be selectable, such as line numbers or
+   shell prompts. Guess which browser this doesn't work in. */
+.noselect {
+    -moz-user-select: -moz-none;
+    -khtml-user-select: none;
+    -webkit-user-select: none;
+    -o-user-select: none;
+    user-select: none;
+}
+
+/* -- Lists ----------------------------------------------------------------- */
+dd { margin: 0.2em 0 0.7em 1em; }
+dl { margin: 1em 0; }
+dt { font-weight: bold; }
+
+/* -- Tables ---------------------------------------------------------------- */
+caption, th { text-align: left; }
+
+table {
+    border-collapse: collapse;
+    width: 100%;
+}
+
+td, th {
+    border: 1px solid #fff;
+    padding: 5px 12px;
+    vertical-align: top;
+}
+
+td { background: #E6E9F5; }
+td dl { margin: 0; }
+td dl dl { margin: 1em 0; }
+td pre:first-child { margin-top: 0; }
+
+th {
+    background: #D2D7E6;/*#97A0BF*/
+    border-bottom: none;
+    border-top: none;
+    color: #000;/*#FFF1D5*/
+    font-family: 'Trebuchet MS', sans-serif;
+    font-weight: bold;
+    line-height: 1.3;
+    white-space: nowrap;
+}
+
+
+/* -- Layout and Content ---------------------------------------------------- */
+#doc {
+    margin: auto;
+    min-width: 1024px;
+}
+
+.content { padding: 0 20px 0 25px; }
+
+.sidebar {
+    padding: 0 15px 0 10px;
+}
+#bd {
+    padding: 7px 0 130px;
+    position: relative;
+    width: 99%;
+}
+
+/* -- Table of Contents ----------------------------------------------------- */
+
+/* The #toc id refers to the single global table of contents, while the .toc
+   class refers to generic TOC lists that could be used throughout the page. */
+
+.toc code, .toc kbd, .toc samp { font-size: 100%; }
+.toc li { font-weight: bold; }
+.toc li li { font-weight: normal; }
+
+/* -- Intro and Example Boxes ----------------------------------------------- */
+/*
+.intro, .example { margin-bottom: 2em; }
+.example {
+    -moz-border-radius: 4px;
+    -webkit-border-radius: 4px;
+    border-radius: 4px;
+    -moz-box-shadow: 0 0 5px #bfbfbf;
+    -webkit-box-shadow: 0 0 5px #bfbfbf;
+    box-shadow: 0 0 5px #bfbfbf;
+    padding: 1em;
+}
+.intro {
+    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
+}
+*/
+
+/* -- Other Styles ---------------------------------------------------------- */
+
+/* These are probably YUI-specific, and should be moved out of Selleck's default
+   theme. */
+
+.button {
+    border: 1px solid #dadada;
+    -moz-border-radius: 3px;
+    -webkit-border-radius: 3px;
+    border-radius: 3px;
+    color: #444;
+    display: inline-block;
+    font-family: Helvetica, Arial, sans-serif;
+    font-size: 92.308%;
+    font-weight: bold;
+    padding: 4px 13px 3px;
+    -moz-text-shadow: 1px 1px 0 #fff;
+    -webkit-text-shadow: 1px 1px 0 #fff;
+    text-shadow: 1px 1px 0 #fff;
+    white-space: nowrap;
+
+    background: #EFEFEF; /* old browsers */
+    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
+    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
+}
+
+.button:hover {
+    border-color: #466899;
+    color: #fff;
+    text-decoration: none;
+    -moz-text-shadow: 1px 1px 0 #222;
+    -webkit-text-shadow: 1px 1px 0 #222;
+    text-shadow: 1px 1px 0 #222;
+
+    background: #6396D8; /* old browsers */
+    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
+    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
+}
+
+.newwindow { text-align: center; }
+
+.header .version em {
+    display: block;
+    text-align: right;
+}
+
+
+#classdocs .item {
+    border-bottom: 1px solid #466899;
+    margin: 1em 0;
+    padding: 1.5em;
+}
+
+#classdocs .item .params p,
+    #classdocs .item .returns p,{
+    display: inline;
+}
+
+#classdocs .item em code, #classdocs .item em.comment {
+    color: green;
+}
+
+#classdocs .item em.comment a {
+    color: green;
+    text-decoration: underline;
+}
+
+#classdocs .foundat {
+    font-size: 11px;
+    font-style: normal;
+}
+
+.attrs .emits {
+    margin-left: 2em;
+    padding: .5em;
+    border-left: 1px dashed #ccc;
+}
+
+abbr {
+    border-bottom: 1px dashed #ccc;
+    font-size: 80%;
+    cursor: help;
+}
+
+.prettyprint li.L0, 
+.prettyprint li.L1, 
+.prettyprint li.L2, 
+.prettyprint li.L3, 
+.prettyprint li.L5, 
+.prettyprint li.L6, 
+.prettyprint li.L7, 
+.prettyprint li.L8 {
+    list-style: decimal;
+}
+
+ul li p {
+    margin-top: 0;
+}
+
+.method .name {
+    font-size: 110%;
+}
+
+.apidocs .methods .extends .method,
+.apidocs .properties .extends .property,
+.apidocs .attrs .extends .attr,
+.apidocs .events .extends .event {
+    font-weight: bold;
+}
+
+.apidocs .methods .extends .inherited,
+.apidocs .properties .extends .inherited,
+.apidocs .attrs .extends .inherited,
+.apidocs .events .extends .inherited {
+    font-weight: normal;
+}
+
+#hd {
+    background: whiteSmoke;
+    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
+    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
+    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
+    border-bottom: 1px solid #DFDFDF;
+    padding: 0 15px 1px 20px;
+    margin-bottom: 15px;
+}
+
+#hd img {
+    margin-right: 10px;
+    vertical-align: middle;
+}
+
+
+/* -- API Docs CSS ---------------------------------------------------------- */
+
+/*
+This file is organized so that more generic styles are nearer the top, and more
+specific styles are nearer the bottom of the file. This allows us to take full
+advantage of the cascade to avoid redundant style rules. Please respect this
+convention when making changes.
+*/
+
+/* -- Generic TabView styles ------------------------------------------------ */
+
+/*
+These styles apply to all API doc tabviews. To change styles only for a
+specific tabview, see the other sections below.
+*/
+
+.yui3-js-enabled .apidocs .tabview {
+    visibility: hidden; /* Hide until the TabView finishes rendering. */
+    _visibility: visible;
+}
+
+.apidocs .tabview.yui3-tabview-content { visibility: visible; }
+.apidocs .tabview .yui3-tabview-panel { background: #fff; }
+
+/* -- Generic Content Styles ------------------------------------------------ */
+
+/* Headings */
+h2, h3, h4, h5, h6 {
+    border: none;
+    color: #30418C;
+    font-weight: bold;
+    text-decoration: none;
+}
+
+.link-docs {
+    float: right;
+    font-size: 15px;
+    margin: 4px 4px 6px;
+    padding: 6px 30px 5px;
+}
+
+.apidocs { zoom: 1; }
+
+/* Generic box styles. */
+.apidocs .box {
+    border: 1px solid;
+    border-radius: 3px;
+    margin: 1em 0;
+    padding: 0 1em;
+}
+
+/* A flag is a compact, capsule-like indicator of some kind. It's used to
+   indicate private and protected items, item return types, etc. in an
+   attractive and unobtrusive way. */
+.apidocs .flag {
+    background: #bababa;
+    border-radius: 3px;
+    color: #fff;
+    font-size: 11px;
+    margin: 0 0.5em;
+    padding: 2px 4px 1px;
+}
+
+/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
+.apidocs .meta {
+    background: #f9f9f9;
+    border-color: #efefef;
+    color: #555;
+    font-size: 11px;
+    padding: 3px 6px;
+}
+
+.apidocs .meta p { margin: 0; }
+
+/* Deprecation warning. */
+.apidocs .box.deprecated,
+.apidocs .flag.deprecated {
+    background: #fdac9f;
+    border: 1px solid #fd7775;
+}
+
+.apidocs .box.deprecated p { margin: 0.5em 0; }
+.apidocs .flag.deprecated { color: #333; }
+
+/* Module/Class intro description. */
+.apidocs .intro {
+    background: #f0f1f8;
+    border-color: #d4d8eb;
+}
+
+/* Loading spinners. */
+#bd.loading .apidocs,
+#api-list.loading .yui3-tabview-panel {
+    background: #fff url(../img/spinner.gif) no-repeat center 70px;
+    min-height: 150px;
+}
+
+#bd.loading .apidocs .content,
+#api-list.loading .yui3-tabview-panel .apis {
+    display: none;
+}
+
+.apidocs .no-visible-items { color: #666; }
+
+/* Generic inline list. */
+.apidocs ul.inline {
+    display: inline;
+    list-style: none;
+    margin: 0;
+    padding: 0;
+}
+
+.apidocs ul.inline li { display: inline; }
+
+/* Comma-separated list. */
+.apidocs ul.commas li:after { content: ','; }
+.apidocs ul.commas li:last-child:after { content: ''; }
+
+/* Keyboard shortcuts. */
+kbd .cmd { font-family: Monaco, Helvetica; }
+
+/* -- Generic Access Level styles ------------------------------------------- */
+.apidocs .item.protected,
+.apidocs .item.private,
+.apidocs .index-item.protected,
+.apidocs .index-item.deprecated,
+.apidocs .index-item.private {
+    display: none;
+}
+
+.show-deprecated .item.deprecated,
+.show-deprecated .index-item.deprecated,
+.show-protected .item.protected,
+.show-protected .index-item.protected,
+.show-private .item.private,
+.show-private .index-item.private {
+    display: block;
+}
+
+.hide-inherited .item.inherited,
+.hide-inherited .index-item.inherited {
+    display: none;
+}
+
+/* -- Generic Item Index styles --------------------------------------------- */
+.apidocs .index { margin: 1.5em 0 3em; }
+
+.apidocs .index h3 {
+    border-bottom: 1px solid #efefef;
+    color: #333;
+    font-size: 13px;
+    margin: 2em 0 0.6em;
+    padding-bottom: 2px;
+}
+
+.apidocs .index .no-visible-items { margin-top: 2em; }
+
+.apidocs .index-list {
+    border-color: #efefef;
+    font-size: 12px;
+    list-style: none;
+    margin: 0;
+    padding: 0;
+    -moz-column-count: 4;
+    -moz-column-gap: 10px;
+    -moz-column-width: 170px;
+    -ms-column-count: 4;
+    -ms-column-gap: 10px;
+    -ms-column-width: 170px;
+    -o-column-count: 4;
+    -o-column-gap: 10px;
+    -o-column-width: 170px;
+    -webkit-column-count: 4;
+    -webkit-column-gap: 10px;
+    -webkit-column-width: 170px;
+    column-count: 4;
+    column-gap: 10px;
+    column-width: 170px;
+}
+
+.apidocs .no-columns .index-list {
+    -moz-column-count: 1;
+    -ms-column-count: 1;
+    -o-column-count: 1;
+    -webkit-column-count: 1;
+    column-count: 1;
+}
+
+.apidocs .index-item { white-space: nowrap; }
+
+.apidocs .index-item .flag {
+    background: none;
+    border: none;
+    color: #afafaf;
+    display: inline;
+    margin: 0 0 0 0.2em;
+    padding: 0;
+}
+
+/* -- Generic API item styles ----------------------------------------------- */
+.apidocs .args {
+    display: inline;
+    margin: 0 0.5em;
+}
+
+.apidocs .flag.chainable { background: #46ca3b; }
+.apidocs .flag.protected { background: #9b86fc; }
+.apidocs .flag.private { background: #fd6b1b; }
+.apidocs .flag.async { background: #356de4; }
+.apidocs .flag.required { background: #e60923; }
+
+.apidocs .item {
+    border-bottom: 1px solid #efefef;
+    margin: 1.5em 0 2em;
+    padding-bottom: 2em;
+}
+
+.apidocs .item h4,
+.apidocs .item h5,
+.apidocs .item h6 {
+    color: #333;
+    font-family: inherit;
+    font-size: 100%;
+}
+
+.apidocs .item .description p,
+.apidocs .item pre.code {
+    margin: 1em 0 0;
+}
+
+.apidocs .item .meta {
+    background: none;
+    border: none;
+    padding: 0;
+}
+
+.apidocs .item .name {
+    display: inline;
+    font-size: 14px;
+}
+
+.apidocs .item .type,
+.apidocs .item .type a,
+.apidocs .returns-inline {
+    color: #555;
+}
+
+.apidocs .item .type,
+.apidocs .returns-inline {
+    font-size: 11px;
+    margin: 0 0 0 0;
+}
+
+.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
+.apidocs .item .type a:hover { border: none; }
+
+/* -- Item Parameter List --------------------------------------------------- */
+.apidocs .params-list {
+    list-style: square;
+    margin: 1em 0 0 2em;
+    padding: 0;
+}
+
+.apidocs .param { margin-bottom: 1em; }
+
+.apidocs .param .type,
+.apidocs .param .type a {
+    color: #666;
+}
+
+.apidocs .param .type {
+    margin: 0 0 0 0.5em;
+    *margin-left: 0.5em;
+}
+
+.apidocs .param-name { font-weight: bold; }
+
+/* -- Item "Emits" block ---------------------------------------------------- */
+.apidocs .item .emits {
+    background: #f9f9f9;
+    border-color: #eaeaea;
+}
+
+/* -- Item "Returns" block -------------------------------------------------- */
+.apidocs .item .returns .type,
+.apidocs .item .returns .type a {
+    font-size: 100%;
+    margin: 0;
+}
+
+/* -- Class Constructor block ----------------------------------------------- */
+.apidocs .constructor .item {
+    border: none;
+    padding-bottom: 0;
+}
+
+/* -- File Source View ------------------------------------------------------ */
+.apidocs .file pre.code,
+#doc .apidocs .file pre.prettyprint {
+    background: inherit;
+    border: none;
+    overflow: visible;
+    padding: 0;
+}
+
+.apidocs .L0,
+.apidocs .L1,
+.apidocs .L2,
+.apidocs .L3,
+.apidocs .L4,
+.apidocs .L5,
+.apidocs .L6,
+.apidocs .L7,
+.apidocs .L8,
+.apidocs .L9 {
+    background: inherit;
+}
+
+/* -- Submodule List -------------------------------------------------------- */
+.apidocs .module-submodule-description {
+    font-size: 12px;
+    margin: 0.3em 0 1em;
+}
+
+.apidocs .module-submodule-description p:first-child { margin-top: 0; }
+
+/* -- Sidebar TabView ------------------------------------------------------- */
+#api-tabview { margin-top: 0.6em; }
+
+#api-tabview-filter,
+#api-tabview-panel {
+    border: 1px solid #dfdfdf;
+}
+
+#api-tabview-filter {
+    border-bottom: none;
+    border-top: none;
+    padding: 0.6em 10px 0 10px;
+}
+
+#api-tabview-panel { border-top: none; }
+#api-filter { width: 97%; }
+
+/* -- Content TabView ------------------------------------------------------- */
+#classdocs .yui3-tabview-panel { border: none; }
+
+/* -- Source File Contents -------------------------------------------------- */
+.prettyprint li.L0,
+.prettyprint li.L1,
+.prettyprint li.L2,
+.prettyprint li.L3,
+.prettyprint li.L5,
+.prettyprint li.L6,
+.prettyprint li.L7,
+.prettyprint li.L8 {
+    list-style: decimal;
+}
+
+/* -- API options ----------------------------------------------------------- */
+#api-options {
+    font-size: 11px;
+    margin-top: 2.2em;
+    position: absolute;
+    right: 1.5em;
+}
+
+/*#api-options label { margin-right: 0.6em; }*/
+
+/* -- API list -------------------------------------------------------------- */
+#api-list {
+    margin-top: 1.5em;
+    *zoom: 1;
+}
+
+.apis {
+    font-size: 12px;
+    line-height: 1.4;
+    list-style: none;
+    margin: 0;
+    padding: 0.5em 0 0.5em 0.4em;
+}
+
+.apis a {
+    border: 1px solid transparent;
+    display: block;
+    margin: 0 0 0 -4px;
+    padding: 1px 4px 0;
+    text-decoration: none;
+    _border: none;
+    _display: inline;
+}
+
+.apis a:hover,
+.apis a:focus {
+    background: #E8EDFC;
+    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
+    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
+    border-color: #AAC0FA;
+    border-radius: 3px;
+    color: #333;
+    outline: none;
+}
+
+.api-list-item a:hover,
+.api-list-item a:focus {
+    font-weight: bold;
+    text-shadow: 1px 1px 1px #fff;
+}
+
+.apis .message { color: #888; }
+.apis .result a { padding: 3px 5px 2px; }
+
+.apis .result .type {
+    right: 4px;
+    top: 7px;
+}
+
+.api-list-item .yui3-highlight {
+    font-weight: bold;
+}
+
diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
new file mode 100644
index 0000000..5a95dda
--- /dev/null
+++ b/docs/assets/favicon.png
Binary files differ
diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
new file mode 100644
index 0000000..44f96ba
--- /dev/null
+++ b/docs/assets/img/spinner.gif
Binary files differ
diff --git a/docs/assets/index.html b/docs/assets/index.html
new file mode 100644
index 0000000..487fe15
--- /dev/null
+++ b/docs/assets/index.html
@@ -0,0 +1,10 @@
+
+
+    
+        Redirector
+        
+    
+    
+        Click here to redirect
+    
+
diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
new file mode 100644
index 0000000..37aefba
--- /dev/null
+++ b/docs/assets/js/api-filter.js
@@ -0,0 +1,52 @@
+YUI.add('api-filter', function (Y) {
+
+Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
+    // -- Initializer ----------------------------------------------------------
+    initializer: function () {
+        this._bindUIACBase();
+        this._syncUIACBase();
+    },
+    getDisplayName: function(name) {
+
+        Y.each(Y.YUIDoc.meta.allModules, function(i) {
+            if (i.name === name && i.displayName) {
+                name = i.displayName;
+            }
+        });
+
+        return name;
+    }
+
+}, {
+    // -- Attributes -----------------------------------------------------------
+    ATTRS: {
+        resultHighlighter: {
+            value: 'phraseMatch'
+        },
+
+        // May be set to "classes" or "modules".
+        queryType: {
+            value: 'classes'
+        },
+
+        source: {
+            valueFn: function() {
+                var self = this;
+                return function(q) {
+                    var data = Y.YUIDoc.meta[self.get('queryType')],
+                        out = [];
+                    Y.each(data, function(v) {
+                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
+                            out.push(v);
+                        }
+                    });
+                    return out;
+                };
+            }
+        }
+    }
+});
+
+}, '3.4.0', {requires: [
+    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
+]});

diff --git a/README.md b/README.md
index d012149..0dd6b82 100644
--- a/README.md
+++ b/README.md
@@ -14,13 +14,12 @@
 ### Current features ###
 
 - webGL renderer (with automatic smart batching allowing for REALLY fast performance)
-- canvas renderer 
+- canvas renderer
 - full scene graph
-- super easy to use API (similar to the flash display list API)
+- super easy to use API (similar to twhe flash display list API)
 - support for texture atlas's
 - asset loader / sprite sheet loader
 - auto detect which renderer should be used
-- handles device context loss
 
 ### Coming soon ###
 
@@ -48,8 +47,8 @@
 	
 	var stage = new PIXI.Stage;
 
-	var bunnyTexture = new PIXI.Texture("bunny.png");
-	var bunny = new PIXI.Sprite(rabbitTexture);
+	var bunnyTexture = new PIXI.Texture.fromImage("bunny.png");
+	var bunny = new PIXI.Sprite(bunnyTexture);
 	
 	bunny.position.x = 400;
 	bunny.position.y = 300;
diff --git a/bin/pixi.js b/bin/pixi.js
index df5858d..65add09 100644
--- a/bin/pixi.js
+++ b/bin/pixi.js
@@ -1,4 +1,4 @@
-window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)};
+var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)};
 var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a,
 d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j*
 j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b=
@@ -45,7 +45,7 @@
 (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType=
 f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"];
 PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"];
-PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l
    
-  	 
+  	 
   	 
 
-  	 	
+        
       
+        
+      	
         
       	
 		
+
 		
 		
-		
-		
-      	
-      	
 		
+		
+		
+		
+		
+      	
 		
 		
 		
 		
 		
 		
+		
 		
 		
+		
 		
 		
 		
+		
+	
       
  
 	
diff --git a/docs/api.js b/docs/api.js
new file mode 100644
index 0000000..ac07693
--- /dev/null
+++ b/docs/api.js
@@ -0,0 +1,29 @@
+YUI.add("yuidoc-meta", function(Y) {
+   Y.YUIDoc = { meta: {
+    "classes": [
+        "AssetLoader",
+        "BaseTexture",
+        "CanvasRenderer",
+        "DisplayObject",
+        "DisplayObjectContainer",
+        "MovieClip",
+        "Point",
+        "Rectangle",
+        "Sprite",
+        "SpriteSheetLoader",
+        "Stage",
+        "Texture",
+        "WebGLBatch",
+        "WebGLRenderer"
+    ],
+    "modules": [
+        "PIXI"
+    ],
+    "allModules": [
+        {
+            "displayName": "PIXI",
+            "name": "PIXI"
+        }
+    ]
+} };
+});
\ No newline at end of file
diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png
new file mode 100644
index 0000000..759a1cd
--- /dev/null
+++ b/docs/assets/css/external-small.png
Binary files differ
diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png
new file mode 100644
index 0000000..609b336
--- /dev/null
+++ b/docs/assets/css/logo.png
Binary files differ
diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css
new file mode 100644
index 0000000..f8f7ee7
--- /dev/null
+++ b/docs/assets/css/main.css
@@ -0,0 +1,782 @@
+/*
+Font sizes for all selectors other than the body are given in percentages,
+with 100% equal to 13px. To calculate a font size percentage, multiply the
+desired size in pixels by 7.6923076923.
+
+Here's a quick lookup table:
+
+10px - 76.923%
+11px - 84.615%
+12px - 92.308%
+13px - 100%
+14px - 107.692%
+15px - 115.385%
+16px - 123.077%
+17px - 130.769%
+18px - 138.462%
+19px - 146.154%
+20px - 153.846%
+*/
+
+html {
+    background: #fff;
+    color: #333;
+    overflow-y: scroll;
+}
+
+body {
+    font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif;
+    margin: 0;
+    padding: 0;
+}
+
+/* -- Links ----------------------------------------------------------------- */
+a {
+    color: #356de4;
+    text-decoration: none;
+}
+
+.hidden {
+    display: none;
+}
+
+a:hover { text-decoration: underline; }
+
+/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from
+   sight until it's focused. */
+.jump {
+    position: absolute;
+    padding: 3px 6px;
+    left: -99999px;
+    top: 0;
+}
+
+.jump:focus { left: 40%; }
+
+/* -- Paragraphs ------------------------------------------------------------ */
+p { margin: 1.3em 0; }
+dd p, td p { margin-bottom: 0; }
+dd p:first-child, td p:first-child { margin-top: 0; }
+
+/* -- Headings -------------------------------------------------------------- */
+h1, h2, h3, h4, h5, h6 {
+    color: #D98527;/*was #f80*/
+    font-family: 'Trebuchet MS', sans-serif;
+    font-weight: bold;
+    line-height: 1.1;
+    margin: 1.1em 0 0.5em;
+}
+
+h1 {
+    font-size: 184.6%;
+    color: #30418C;
+    margin: 0.75em 0 0.5em;
+}
+
+h2 {
+    font-size: 153.846%;
+    color: #E48A2B;
+}
+
+h3 { font-size: 138.462%; }
+
+h4 {
+    border-bottom: 1px solid #DBDFEA;
+    color: #E48A2B;
+    font-size: 115.385%;
+    font-weight: normal;
+    padding-bottom: 2px;
+}
+
+h5, h6 { font-size: 107.692%; }
+
+/* -- Code and examples ----------------------------------------------------- */
+code, kbd, pre, samp {
+    font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;
+    font-size: 92.308%;
+    line-height: 1.35;
+}
+
+p code, p kbd, p samp {
+    background: #FCFBFA;
+    border: 1px solid #EFEEED;
+    padding: 0 3px;
+}
+
+a code, a kbd, a samp,
+pre code, pre kbd, pre samp,
+table code, table kbd, table samp,
+.intro code, .intro kbd, .intro samp,
+.toc code, .toc kbd, .toc samp {
+    background: none;
+    border: none;
+    padding: 0;
+}
+
+pre.code, pre.terminal, pre.cmd {
+    overflow-x: auto;
+    *overflow-x: scroll;
+    padding: 0.3em 0.6em;
+}
+
+pre.code {
+    background: #FCFBFA;
+    border: 1px solid #EFEEED;
+    border-left-width: 5px;
+}
+
+pre.terminal, pre.cmd {
+    background: #F0EFFC;
+    border: 1px solid #D0CBFB;
+    border-left: 5px solid #D0CBFB;
+}
+
+/* Don't reduce the font size of // elements inside 
+   blocks. */
+pre code, pre kbd, pre samp { font-size: 100%; }
+
+/* Used to denote text that shouldn't be selectable, such as line numbers or
+   shell prompts. Guess which browser this doesn't work in. */
+.noselect {
+    -moz-user-select: -moz-none;
+    -khtml-user-select: none;
+    -webkit-user-select: none;
+    -o-user-select: none;
+    user-select: none;
+}
+
+/* -- Lists ----------------------------------------------------------------- */
+dd { margin: 0.2em 0 0.7em 1em; }
+dl { margin: 1em 0; }
+dt { font-weight: bold; }
+
+/* -- Tables ---------------------------------------------------------------- */
+caption, th { text-align: left; }
+
+table {
+    border-collapse: collapse;
+    width: 100%;
+}
+
+td, th {
+    border: 1px solid #fff;
+    padding: 5px 12px;
+    vertical-align: top;
+}
+
+td { background: #E6E9F5; }
+td dl { margin: 0; }
+td dl dl { margin: 1em 0; }
+td pre:first-child { margin-top: 0; }
+
+th {
+    background: #D2D7E6;/*#97A0BF*/
+    border-bottom: none;
+    border-top: none;
+    color: #000;/*#FFF1D5*/
+    font-family: 'Trebuchet MS', sans-serif;
+    font-weight: bold;
+    line-height: 1.3;
+    white-space: nowrap;
+}
+
+
+/* -- Layout and Content ---------------------------------------------------- */
+#doc {
+    margin: auto;
+    min-width: 1024px;
+}
+
+.content { padding: 0 20px 0 25px; }
+
+.sidebar {
+    padding: 0 15px 0 10px;
+}
+#bd {
+    padding: 7px 0 130px;
+    position: relative;
+    width: 99%;
+}
+
+/* -- Table of Contents ----------------------------------------------------- */
+
+/* The #toc id refers to the single global table of contents, while the .toc
+   class refers to generic TOC lists that could be used throughout the page. */
+
+.toc code, .toc kbd, .toc samp { font-size: 100%; }
+.toc li { font-weight: bold; }
+.toc li li { font-weight: normal; }
+
+/* -- Intro and Example Boxes ----------------------------------------------- */
+/*
+.intro, .example { margin-bottom: 2em; }
+.example {
+    -moz-border-radius: 4px;
+    -webkit-border-radius: 4px;
+    border-radius: 4px;
+    -moz-box-shadow: 0 0 5px #bfbfbf;
+    -webkit-box-shadow: 0 0 5px #bfbfbf;
+    box-shadow: 0 0 5px #bfbfbf;
+    padding: 1em;
+}
+.intro {
+    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
+}
+*/
+
+/* -- Other Styles ---------------------------------------------------------- */
+
+/* These are probably YUI-specific, and should be moved out of Selleck's default
+   theme. */
+
+.button {
+    border: 1px solid #dadada;
+    -moz-border-radius: 3px;
+    -webkit-border-radius: 3px;
+    border-radius: 3px;
+    color: #444;
+    display: inline-block;
+    font-family: Helvetica, Arial, sans-serif;
+    font-size: 92.308%;
+    font-weight: bold;
+    padding: 4px 13px 3px;
+    -moz-text-shadow: 1px 1px 0 #fff;
+    -webkit-text-shadow: 1px 1px 0 #fff;
+    text-shadow: 1px 1px 0 #fff;
+    white-space: nowrap;
+
+    background: #EFEFEF; /* old browsers */
+    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
+    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
+}
+
+.button:hover {
+    border-color: #466899;
+    color: #fff;
+    text-decoration: none;
+    -moz-text-shadow: 1px 1px 0 #222;
+    -webkit-text-shadow: 1px 1px 0 #222;
+    text-shadow: 1px 1px 0 #222;
+
+    background: #6396D8; /* old browsers */
+    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
+    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
+}
+
+.newwindow { text-align: center; }
+
+.header .version em {
+    display: block;
+    text-align: right;
+}
+
+
+#classdocs .item {
+    border-bottom: 1px solid #466899;
+    margin: 1em 0;
+    padding: 1.5em;
+}
+
+#classdocs .item .params p,
+    #classdocs .item .returns p,{
+    display: inline;
+}
+
+#classdocs .item em code, #classdocs .item em.comment {
+    color: green;
+}
+
+#classdocs .item em.comment a {
+    color: green;
+    text-decoration: underline;
+}
+
+#classdocs .foundat {
+    font-size: 11px;
+    font-style: normal;
+}
+
+.attrs .emits {
+    margin-left: 2em;
+    padding: .5em;
+    border-left: 1px dashed #ccc;
+}
+
+abbr {
+    border-bottom: 1px dashed #ccc;
+    font-size: 80%;
+    cursor: help;
+}
+
+.prettyprint li.L0, 
+.prettyprint li.L1, 
+.prettyprint li.L2, 
+.prettyprint li.L3, 
+.prettyprint li.L5, 
+.prettyprint li.L6, 
+.prettyprint li.L7, 
+.prettyprint li.L8 {
+    list-style: decimal;
+}
+
+ul li p {
+    margin-top: 0;
+}
+
+.method .name {
+    font-size: 110%;
+}
+
+.apidocs .methods .extends .method,
+.apidocs .properties .extends .property,
+.apidocs .attrs .extends .attr,
+.apidocs .events .extends .event {
+    font-weight: bold;
+}
+
+.apidocs .methods .extends .inherited,
+.apidocs .properties .extends .inherited,
+.apidocs .attrs .extends .inherited,
+.apidocs .events .extends .inherited {
+    font-weight: normal;
+}
+
+#hd {
+    background: whiteSmoke;
+    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
+    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
+    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
+    border-bottom: 1px solid #DFDFDF;
+    padding: 0 15px 1px 20px;
+    margin-bottom: 15px;
+}
+
+#hd img {
+    margin-right: 10px;
+    vertical-align: middle;
+}
+
+
+/* -- API Docs CSS ---------------------------------------------------------- */
+
+/*
+This file is organized so that more generic styles are nearer the top, and more
+specific styles are nearer the bottom of the file. This allows us to take full
+advantage of the cascade to avoid redundant style rules. Please respect this
+convention when making changes.
+*/
+
+/* -- Generic TabView styles ------------------------------------------------ */
+
+/*
+These styles apply to all API doc tabviews. To change styles only for a
+specific tabview, see the other sections below.
+*/
+
+.yui3-js-enabled .apidocs .tabview {
+    visibility: hidden; /* Hide until the TabView finishes rendering. */
+    _visibility: visible;
+}
+
+.apidocs .tabview.yui3-tabview-content { visibility: visible; }
+.apidocs .tabview .yui3-tabview-panel { background: #fff; }
+
+/* -- Generic Content Styles ------------------------------------------------ */
+
+/* Headings */
+h2, h3, h4, h5, h6 {
+    border: none;
+    color: #30418C;
+    font-weight: bold;
+    text-decoration: none;
+}
+
+.link-docs {
+    float: right;
+    font-size: 15px;
+    margin: 4px 4px 6px;
+    padding: 6px 30px 5px;
+}
+
+.apidocs { zoom: 1; }
+
+/* Generic box styles. */
+.apidocs .box {
+    border: 1px solid;
+    border-radius: 3px;
+    margin: 1em 0;
+    padding: 0 1em;
+}
+
+/* A flag is a compact, capsule-like indicator of some kind. It's used to
+   indicate private and protected items, item return types, etc. in an
+   attractive and unobtrusive way. */
+.apidocs .flag {
+    background: #bababa;
+    border-radius: 3px;
+    color: #fff;
+    font-size: 11px;
+    margin: 0 0.5em;
+    padding: 2px 4px 1px;
+}
+
+/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
+.apidocs .meta {
+    background: #f9f9f9;
+    border-color: #efefef;
+    color: #555;
+    font-size: 11px;
+    padding: 3px 6px;
+}
+
+.apidocs .meta p { margin: 0; }
+
+/* Deprecation warning. */
+.apidocs .box.deprecated,
+.apidocs .flag.deprecated {
+    background: #fdac9f;
+    border: 1px solid #fd7775;
+}
+
+.apidocs .box.deprecated p { margin: 0.5em 0; }
+.apidocs .flag.deprecated { color: #333; }
+
+/* Module/Class intro description. */
+.apidocs .intro {
+    background: #f0f1f8;
+    border-color: #d4d8eb;
+}
+
+/* Loading spinners. */
+#bd.loading .apidocs,
+#api-list.loading .yui3-tabview-panel {
+    background: #fff url(../img/spinner.gif) no-repeat center 70px;
+    min-height: 150px;
+}
+
+#bd.loading .apidocs .content,
+#api-list.loading .yui3-tabview-panel .apis {
+    display: none;
+}
+
+.apidocs .no-visible-items { color: #666; }
+
+/* Generic inline list. */
+.apidocs ul.inline {
+    display: inline;
+    list-style: none;
+    margin: 0;
+    padding: 0;
+}
+
+.apidocs ul.inline li { display: inline; }
+
+/* Comma-separated list. */
+.apidocs ul.commas li:after { content: ','; }
+.apidocs ul.commas li:last-child:after { content: ''; }
+
+/* Keyboard shortcuts. */
+kbd .cmd { font-family: Monaco, Helvetica; }
+
+/* -- Generic Access Level styles ------------------------------------------- */
+.apidocs .item.protected,
+.apidocs .item.private,
+.apidocs .index-item.protected,
+.apidocs .index-item.deprecated,
+.apidocs .index-item.private {
+    display: none;
+}
+
+.show-deprecated .item.deprecated,
+.show-deprecated .index-item.deprecated,
+.show-protected .item.protected,
+.show-protected .index-item.protected,
+.show-private .item.private,
+.show-private .index-item.private {
+    display: block;
+}
+
+.hide-inherited .item.inherited,
+.hide-inherited .index-item.inherited {
+    display: none;
+}
+
+/* -- Generic Item Index styles --------------------------------------------- */
+.apidocs .index { margin: 1.5em 0 3em; }
+
+.apidocs .index h3 {
+    border-bottom: 1px solid #efefef;
+    color: #333;
+    font-size: 13px;
+    margin: 2em 0 0.6em;
+    padding-bottom: 2px;
+}
+
+.apidocs .index .no-visible-items { margin-top: 2em; }
+
+.apidocs .index-list {
+    border-color: #efefef;
+    font-size: 12px;
+    list-style: none;
+    margin: 0;
+    padding: 0;
+    -moz-column-count: 4;
+    -moz-column-gap: 10px;
+    -moz-column-width: 170px;
+    -ms-column-count: 4;
+    -ms-column-gap: 10px;
+    -ms-column-width: 170px;
+    -o-column-count: 4;
+    -o-column-gap: 10px;
+    -o-column-width: 170px;
+    -webkit-column-count: 4;
+    -webkit-column-gap: 10px;
+    -webkit-column-width: 170px;
+    column-count: 4;
+    column-gap: 10px;
+    column-width: 170px;
+}
+
+.apidocs .no-columns .index-list {
+    -moz-column-count: 1;
+    -ms-column-count: 1;
+    -o-column-count: 1;
+    -webkit-column-count: 1;
+    column-count: 1;
+}
+
+.apidocs .index-item { white-space: nowrap; }
+
+.apidocs .index-item .flag {
+    background: none;
+    border: none;
+    color: #afafaf;
+    display: inline;
+    margin: 0 0 0 0.2em;
+    padding: 0;
+}
+
+/* -- Generic API item styles ----------------------------------------------- */
+.apidocs .args {
+    display: inline;
+    margin: 0 0.5em;
+}
+
+.apidocs .flag.chainable { background: #46ca3b; }
+.apidocs .flag.protected { background: #9b86fc; }
+.apidocs .flag.private { background: #fd6b1b; }
+.apidocs .flag.async { background: #356de4; }
+.apidocs .flag.required { background: #e60923; }
+
+.apidocs .item {
+    border-bottom: 1px solid #efefef;
+    margin: 1.5em 0 2em;
+    padding-bottom: 2em;
+}
+
+.apidocs .item h4,
+.apidocs .item h5,
+.apidocs .item h6 {
+    color: #333;
+    font-family: inherit;
+    font-size: 100%;
+}
+
+.apidocs .item .description p,
+.apidocs .item pre.code {
+    margin: 1em 0 0;
+}
+
+.apidocs .item .meta {
+    background: none;
+    border: none;
+    padding: 0;
+}
+
+.apidocs .item .name {
+    display: inline;
+    font-size: 14px;
+}
+
+.apidocs .item .type,
+.apidocs .item .type a,
+.apidocs .returns-inline {
+    color: #555;
+}
+
+.apidocs .item .type,
+.apidocs .returns-inline {
+    font-size: 11px;
+    margin: 0 0 0 0;
+}
+
+.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
+.apidocs .item .type a:hover { border: none; }
+
+/* -- Item Parameter List --------------------------------------------------- */
+.apidocs .params-list {
+    list-style: square;
+    margin: 1em 0 0 2em;
+    padding: 0;
+}
+
+.apidocs .param { margin-bottom: 1em; }
+
+.apidocs .param .type,
+.apidocs .param .type a {
+    color: #666;
+}
+
+.apidocs .param .type {
+    margin: 0 0 0 0.5em;
+    *margin-left: 0.5em;
+}
+
+.apidocs .param-name { font-weight: bold; }
+
+/* -- Item "Emits" block ---------------------------------------------------- */
+.apidocs .item .emits {
+    background: #f9f9f9;
+    border-color: #eaeaea;
+}
+
+/* -- Item "Returns" block -------------------------------------------------- */
+.apidocs .item .returns .type,
+.apidocs .item .returns .type a {
+    font-size: 100%;
+    margin: 0;
+}
+
+/* -- Class Constructor block ----------------------------------------------- */
+.apidocs .constructor .item {
+    border: none;
+    padding-bottom: 0;
+}
+
+/* -- File Source View ------------------------------------------------------ */
+.apidocs .file pre.code,
+#doc .apidocs .file pre.prettyprint {
+    background: inherit;
+    border: none;
+    overflow: visible;
+    padding: 0;
+}
+
+.apidocs .L0,
+.apidocs .L1,
+.apidocs .L2,
+.apidocs .L3,
+.apidocs .L4,
+.apidocs .L5,
+.apidocs .L6,
+.apidocs .L7,
+.apidocs .L8,
+.apidocs .L9 {
+    background: inherit;
+}
+
+/* -- Submodule List -------------------------------------------------------- */
+.apidocs .module-submodule-description {
+    font-size: 12px;
+    margin: 0.3em 0 1em;
+}
+
+.apidocs .module-submodule-description p:first-child { margin-top: 0; }
+
+/* -- Sidebar TabView ------------------------------------------------------- */
+#api-tabview { margin-top: 0.6em; }
+
+#api-tabview-filter,
+#api-tabview-panel {
+    border: 1px solid #dfdfdf;
+}
+
+#api-tabview-filter {
+    border-bottom: none;
+    border-top: none;
+    padding: 0.6em 10px 0 10px;
+}
+
+#api-tabview-panel { border-top: none; }
+#api-filter { width: 97%; }
+
+/* -- Content TabView ------------------------------------------------------- */
+#classdocs .yui3-tabview-panel { border: none; }
+
+/* -- Source File Contents -------------------------------------------------- */
+.prettyprint li.L0,
+.prettyprint li.L1,
+.prettyprint li.L2,
+.prettyprint li.L3,
+.prettyprint li.L5,
+.prettyprint li.L6,
+.prettyprint li.L7,
+.prettyprint li.L8 {
+    list-style: decimal;
+}
+
+/* -- API options ----------------------------------------------------------- */
+#api-options {
+    font-size: 11px;
+    margin-top: 2.2em;
+    position: absolute;
+    right: 1.5em;
+}
+
+/*#api-options label { margin-right: 0.6em; }*/
+
+/* -- API list -------------------------------------------------------------- */
+#api-list {
+    margin-top: 1.5em;
+    *zoom: 1;
+}
+
+.apis {
+    font-size: 12px;
+    line-height: 1.4;
+    list-style: none;
+    margin: 0;
+    padding: 0.5em 0 0.5em 0.4em;
+}
+
+.apis a {
+    border: 1px solid transparent;
+    display: block;
+    margin: 0 0 0 -4px;
+    padding: 1px 4px 0;
+    text-decoration: none;
+    _border: none;
+    _display: inline;
+}
+
+.apis a:hover,
+.apis a:focus {
+    background: #E8EDFC;
+    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
+    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
+    border-color: #AAC0FA;
+    border-radius: 3px;
+    color: #333;
+    outline: none;
+}
+
+.api-list-item a:hover,
+.api-list-item a:focus {
+    font-weight: bold;
+    text-shadow: 1px 1px 1px #fff;
+}
+
+.apis .message { color: #888; }
+.apis .result a { padding: 3px 5px 2px; }
+
+.apis .result .type {
+    right: 4px;
+    top: 7px;
+}
+
+.api-list-item .yui3-highlight {
+    font-weight: bold;
+}
+
diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
new file mode 100644
index 0000000..5a95dda
--- /dev/null
+++ b/docs/assets/favicon.png
Binary files differ
diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
new file mode 100644
index 0000000..44f96ba
--- /dev/null
+++ b/docs/assets/img/spinner.gif
Binary files differ
diff --git a/docs/assets/index.html b/docs/assets/index.html
new file mode 100644
index 0000000..487fe15
--- /dev/null
+++ b/docs/assets/index.html
@@ -0,0 +1,10 @@
+
+
+    
+        Redirector
+        
+    
+    
+        Click here to redirect
+    
+
diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
new file mode 100644
index 0000000..37aefba
--- /dev/null
+++ b/docs/assets/js/api-filter.js
@@ -0,0 +1,52 @@
+YUI.add('api-filter', function (Y) {
+
+Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
+    // -- Initializer ----------------------------------------------------------
+    initializer: function () {
+        this._bindUIACBase();
+        this._syncUIACBase();
+    },
+    getDisplayName: function(name) {
+
+        Y.each(Y.YUIDoc.meta.allModules, function(i) {
+            if (i.name === name && i.displayName) {
+                name = i.displayName;
+            }
+        });
+
+        return name;
+    }
+
+}, {
+    // -- Attributes -----------------------------------------------------------
+    ATTRS: {
+        resultHighlighter: {
+            value: 'phraseMatch'
+        },
+
+        // May be set to "classes" or "modules".
+        queryType: {
+            value: 'classes'
+        },
+
+        source: {
+            valueFn: function() {
+                var self = this;
+                return function(q) {
+                    var data = Y.YUIDoc.meta[self.get('queryType')],
+                        out = [];
+                    Y.each(data, function(v) {
+                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
+                            out.push(v);
+                        }
+                    });
+                    return out;
+                };
+            }
+        }
+    }
+});
+
+}, '3.4.0', {requires: [
+    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
+]});
diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
new file mode 100644
index 0000000..88905b5
--- /dev/null
+++ b/docs/assets/js/api-list.js
@@ -0,0 +1,251 @@
+YUI.add('api-list', function (Y) {
+
+var Lang   = Y.Lang,
+    YArray = Y.Array,
+
+    APIList = Y.namespace('APIList'),
+
+    classesNode    = Y.one('#api-classes'),
+    inputNode      = Y.one('#api-filter'),
+    modulesNode    = Y.one('#api-modules'),
+    tabviewNode    = Y.one('#api-tabview'),
+
+    tabs = APIList.tabs = {},
+
+    filter = APIList.filter = new Y.APIFilter({
+        inputNode : inputNode,
+        maxResults: 1000,
+
+        on: {
+            results: onFilterResults
+        }
+    }),
+
+    search = APIList.search = new Y.APISearch({
+        inputNode : inputNode,
+        maxResults: 100,
+
+        on: {
+            clear  : onSearchClear,
+            results: onSearchResults
+        }
+    }),
+
+    tabview = APIList.tabview = new Y.TabView({
+        srcNode  : tabviewNode,
+        panelNode: '#api-tabview-panel',
+        render   : true,
+
+        on: {
+            selectionChange: onTabSelectionChange
+        }
+    }),
+
+    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
+        circular   : true,
+        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
+        keys       : {next: 'down:40', previous: 'down:38'}
+    }).focusManager,
+
+    LIST_ITEM_TEMPLATE =
+        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/examples/bunny benchmark/index.html b/examples/bunny benchmark/index.html index 7c5521b..95972c4 100644 --- a/examples/bunny benchmark/index.html +++ b/examples/bunny benchmark/index.html @@ -9,9 +9,10 @@ +
    Click to add more bunnys! Let me know how many you get on screen here @doormat23
    - + diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/examples/bunny benchmark/index.html b/examples/bunny benchmark/index.html index 7c5521b..95972c4 100644 --- a/examples/bunny benchmark/index.html +++ b/examples/bunny benchmark/index.html @@ -9,9 +9,10 @@ +
    Click to add more bunnys! Let me know how many you get on screen here @doormat23
    - + diff --git a/examples/bunny benchmark/js/bunnyBenchMark.js b/examples/bunny benchmark/js/bunnyBenchMark.js index a3154eb..c3c8ec5 100644 --- a/examples/bunny benchmark/js/bunnyBenchMark.js +++ b/examples/bunny benchmark/js/bunnyBenchMark.js @@ -22,18 +22,13 @@ var count = 0; var container; +var detail; + function onReady() { - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() + detail = document.getElementById("pixi"); - if(webgl) - { - renderer = new PIXI.WebGLRenderer(); - } - else - { - renderer = new PIXI.CanvasRenderer(480, 320); - } + renderer = PIXI.autoDetectRenderer(); stage = new PIXI.Stage; @@ -46,7 +41,7 @@ stats.domElement.style.top = "0px"; requestAnimFrame(update); - wabbitTexture = new PIXI.Texture("wabbit.png") + wabbitTexture = new PIXI.Texture.fromImage("wabbit.png") counter = document.createElement("div"); counter.className = "counter"; @@ -55,7 +50,6 @@ count = startBunnyCount; counter.innerHTML = count + " BUNNIES"; - container = new PIXI.DisplayObjectContainer(); stage.addChild(container); @@ -114,7 +108,9 @@ minX = 0; maxY = height; minY = 0; - + + detail.style.left = width - 204 + "px"; + detail.style.top = height - 100 + "px"; renderer.resize(width, height); } @@ -126,17 +122,17 @@ { // add 10 at a time :) - for (var i = 0; i < 2; i++) + for (var i = 0; i < 10; i++) { - var bunny = new PIXI.Sprite(wabbitTexture, {x:0, y:0, width:26, height:37}); + var bunny = new PIXI.Sprite(wabbitTexture); bunny.speedX = Math.random() * 10; bunny.speedY = (Math.random() * 10) - 5; bunny.anchor.x = 0.5; bunny.anchor.y = 1; - bunny.alpha = 0.3 + Math.random() * 0.7; + //bunny.alpha = 0.3 + Math.random() * 0.7; bunnys.push(bunny); - bunny.rotation = Math.random() - 0.5; + //bunny.rotation = Math.random() - 0.5; container.addChild(bunny); count++; diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/examples/bunny benchmark/index.html b/examples/bunny benchmark/index.html index 7c5521b..95972c4 100644 --- a/examples/bunny benchmark/index.html +++ b/examples/bunny benchmark/index.html @@ -9,9 +9,10 @@ +
    Click to add more bunnys! Let me know how many you get on screen here @doormat23
    - + diff --git a/examples/bunny benchmark/js/bunnyBenchMark.js b/examples/bunny benchmark/js/bunnyBenchMark.js index a3154eb..c3c8ec5 100644 --- a/examples/bunny benchmark/js/bunnyBenchMark.js +++ b/examples/bunny benchmark/js/bunnyBenchMark.js @@ -22,18 +22,13 @@ var count = 0; var container; +var detail; + function onReady() { - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() + detail = document.getElementById("pixi"); - if(webgl) - { - renderer = new PIXI.WebGLRenderer(); - } - else - { - renderer = new PIXI.CanvasRenderer(480, 320); - } + renderer = PIXI.autoDetectRenderer(); stage = new PIXI.Stage; @@ -46,7 +41,7 @@ stats.domElement.style.top = "0px"; requestAnimFrame(update); - wabbitTexture = new PIXI.Texture("wabbit.png") + wabbitTexture = new PIXI.Texture.fromImage("wabbit.png") counter = document.createElement("div"); counter.className = "counter"; @@ -55,7 +50,6 @@ count = startBunnyCount; counter.innerHTML = count + " BUNNIES"; - container = new PIXI.DisplayObjectContainer(); stage.addChild(container); @@ -114,7 +108,9 @@ minX = 0; maxY = height; minY = 0; - + + detail.style.left = width - 204 + "px"; + detail.style.top = height - 100 + "px"; renderer.resize(width, height); } @@ -126,17 +122,17 @@ { // add 10 at a time :) - for (var i = 0; i < 2; i++) + for (var i = 0; i < 10; i++) { - var bunny = new PIXI.Sprite(wabbitTexture, {x:0, y:0, width:26, height:37}); + var bunny = new PIXI.Sprite(wabbitTexture); bunny.speedX = Math.random() * 10; bunny.speedY = (Math.random() * 10) - 5; bunny.anchor.x = 0.5; bunny.anchor.y = 1; - bunny.alpha = 0.3 + Math.random() * 0.7; + //bunny.alpha = 0.3 + Math.random() * 0.7; bunnys.push(bunny); - bunny.rotation = Math.random() - 0.5; + //bunny.rotation = Math.random() - 0.5; container.addChild(bunny); count++; diff --git a/examples/bunny benchmark/js/pixi.js b/examples/bunny benchmark/js/pixi.js new file mode 100644 index 0000000..65add09 --- /dev/null +++ b/examples/bunny benchmark/js/pixi.js @@ -0,0 +1,110 @@ +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, +d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* +j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= +a[0]-d[0],c=a[1]-d[1];a=a[2]-d[2];d=Math.sqrt(b*b+c*c+a*a);if(!d)return j[0]=0,j[1]=0,j[2]=0,j;d=1/d;j[0]=b*d;j[1]=c*d;j[2]=a*d;return j},lerp:function(a,d,j,b){b||(b=a);b[0]=a[0]+j*(d[0]-a[0]);b[1]=a[1]+j*(d[1]-a[1]);b[2]=a[2]+j*(d[2]-a[2]);return b},dist:function(a,d){var j=d[0]-a[0],b=d[1]-a[1],c=d[2]-a[2];return Math.sqrt(j*j+b*b+c*c)}},p=null,q=new k(4);l.unproject=function(a,d,j,b,c){c||(c=a);p||(p=t.create());var e=p;q[0]=2*(a[0]-b[0])/b[2]-1;q[1]=2*(a[1]-b[1])/b[3]-1;q[2]=2*a[2]-1;q[3]=1; +t.multiply(j,d,e);if(!t.inverse(e))return null;t.multiplyVec4(e,q);if(0===q[3])return null;c[0]=q[0]/q[3];c[1]=q[1]/q[3];c[2]=q[2]/q[3];return c};var C=l.createFrom(1,0,0),F=l.createFrom(0,1,0),u=l.createFrom(0,0,1),w=l.create();l.rotationTo=function(a,d,j){j||(j=m.create());var b=l.dot(a,d);if(1<=b)m.set(H,j);else if(-0.999999>b)l.cross(C,a,w),1E-6>l.length(w)&&l.cross(F,a,w),1E-6>l.length(w)&&l.cross(u,a,w),l.normalize(w),m.fromAngleAxis(Math.PI,w,j);else{var b=Math.sqrt(2*(1+b)),c=1/b;l.cross(a, +d,w);j[0]=w[0]*c;j[1]=w[1]*c;j[2]=w[2]*c;j[3]=0.5*b;m.normalize(j)}1j[3]&&(j[3]=-1);return j};l.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var x={create:function(a){var d=new k(9);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8]):d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=0;return d},createFrom:function(a,d,j,b,c,e,n,f,E){var s=new k(9);s[0]=a;s[1]=d;s[2]=j;s[3]=b;s[4]=c;s[5]=e;s[6]=n;s[7]=f;s[8]=E;return s},determinant:function(a){var d= +a[3],j=a[4],b=a[5],c=a[6],e=a[7],n=a[8];return a[0]*(n*j-b*e)+a[1]*(-n*d+b*c)+a[2]*(e*d-j*c)},inverse:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[3],n=a[4],f=a[5],E=a[6],s=a[7],I=a[8],g=I*n-f*s,h=-I*e+f*E,k=s*e-n*E,r=j*g+b*h+c*k;if(!r)return null;r=1/r;d||(d=x.create());d[0]=g*r;d[1]=(-I*b+c*s)*r;d[2]=(f*b-c*n)*r;d[3]=h*r;d[4]=(I*j-c*E)*r;d[5]=(-f*j+c*e)*r;d[6]=k*r;d[7]=(-s*j+b*E)*r;d[8]=(n*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],D=a[4],E=a[5],s=a[6],I= +a[7];a=a[8];var g=d[0],h=d[1],k=d[2],r=d[3],m=d[4],l=d[5],q=d[6],v=d[7];d=d[8];j[0]=g*b+h*f+k*s;j[1]=g*c+h*D+k*I;j[2]=g*e+h*E+k*a;j[3]=r*b+m*f+l*s;j[4]=r*c+m*D+l*I;j[5]=r*e+m*E+l*a;j[6]=q*b+v*f+d*s;j[7]=q*c+v*D+d*I;j[8]=q*e+v*E+d*a;return j},multiplyVec2:function(a,d,j){j||(j=d);var b=d[0];d=d[1];j[0]=b*a[0]+d*a[3]+a[6];j[1]=b*a[1]+d*a[4]+a[7];return j},multiplyVec3:function(a,d,j){j||(j=d);var b=d[0],c=d[1];d=d[2];j[0]=b*a[0]+c*a[3]+d*a[6];j[1]=b*a[1]+c*a[4]+d*a[7];j[2]=b*a[2]+c*a[5]+d*a[8];return j}, +set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])},identity:function(a){a||(a=x.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, +d){if(!d||a===d){var j=a[1],b=a[2],c=a[5];a[1]=a[3];a[2]=a[6];a[3]=j;a[5]=a[7];a[6]=b;a[7]=c;return a}d[0]=a[0];d[1]=a[3];d[2]=a[6];d[3]=a[1];d[4]=a[4];d[5]=a[7];d[6]=a[2];d[7]=a[5];d[8]=a[8];return d},toMat4:function(a,d){d||(d=t.create());d[15]=1;d[14]=0;d[13]=0;d[12]=0;d[11]=0;d[10]=a[8];d[9]=a[7];d[8]=a[6];d[7]=0;d[6]=a[5];d[5]=a[4];d[4]=a[3];d[3]=0;d[2]=a[2];d[1]=a[1];d[0]=a[0];return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ +a[8]+"]"}},t={create:function(a){var d=new k(16);a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8],d[9]=a[9],d[10]=a[10],d[11]=a[11],d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d},createFrom:function(a,d,j,b,c,e,f,D,E,s,g,h,m,l,r,q){var A=new k(16);A[0]=a;A[1]=d;A[2]=j;A[3]=b;A[4]=c;A[5]=e;A[6]=f;A[7]=D;A[8]=E;A[9]=s;A[10]=g;A[11]=h;A[12]=m;A[13]=l;A[14]=r;A[15]=q;return A},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4]; +d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=a[12];d[13]=a[13];d[14]=a[14];d[15]=a[15];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])&&1E-6>Math.abs(a[9]-d[9])&&1E-6>Math.abs(a[10]-d[10])&&1E-6>Math.abs(a[11]-d[11])&&1E-6>Math.abs(a[12]- +d[12])&&1E-6>Math.abs(a[13]-d[13])&&1E-6>Math.abs(a[14]-d[14])&&1E-6>Math.abs(a[15]-d[15])},identity:function(a){a||(a=t.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,d){if(!d||a===d){var j=a[1],b=a[2],c=a[3],e=a[6],f=a[7],D=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=j;a[6]=a[9];a[7]=a[13];a[8]=b;a[9]=e;a[11]=a[14];a[12]=c;a[13]=f;a[14]=D;return a}d[0]=a[0];d[1]=a[4];d[2]=a[8];d[3]=a[12]; +d[4]=a[1];d[5]=a[5];d[6]=a[9];d[7]=a[13];d[8]=a[2];d[9]=a[6];d[10]=a[10];d[11]=a[14];d[12]=a[3];d[13]=a[7];d[14]=a[11];d[15]=a[15];return d},determinant:function(a){var d=a[0],j=a[1],b=a[2],c=a[3],e=a[4],f=a[5],D=a[6],E=a[7],s=a[8],g=a[9],h=a[10],k=a[11],m=a[12],r=a[13],l=a[14];a=a[15];return m*g*D*c-s*r*D*c-m*f*h*c+e*r*h*c+s*f*l*c-e*g*l*c-m*g*b*E+s*r*b*E+m*j*h*E-d*r*h*E-s*j*l*E+d*g*l*E+m*f*b*k-e*r*b*k-m*j*D*k+d*r*D*k+e*j*l*k-d*f*l*k-s*f*b*a+e*g*b*a+s*j*D*a-d*g*D*a-e*j*h*a+d*f*h*a},inverse:function(a, +d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=a[3],f=a[4],D=a[5],E=a[6],s=a[7],g=a[8],h=a[9],k=a[10],m=a[11],r=a[12],l=a[13],A=a[14],q=a[15],v=j*D-b*f,J=j*E-c*f,y=j*s-e*f,z=b*E-c*D,t=b*s-e*D,u=c*s-e*E,p=g*l-h*r,w=g*A-k*r,x=g*q-m*r,B=h*A-k*l,C=h*q-m*l,F=k*q-m*A,G=v*F-J*C+y*B+z*x-t*w+u*p;if(!G)return null;G=1/G;d[0]=(D*F-E*C+s*B)*G;d[1]=(-b*F+c*C-e*B)*G;d[2]=(l*u-A*t+q*z)*G;d[3]=(-h*u+k*t-m*z)*G;d[4]=(-f*F+E*x-s*w)*G;d[5]=(j*F-c*x+e*w)*G;d[6]=(-r*u+A*y-q*J)*G;d[7]=(g*u-k*y+m*J)*G;d[8]=(f*C-D*x+s*p)*G;d[9]= +(-j*C+b*x-e*p)*G;d[10]=(r*t-l*y+q*v)*G;d[11]=(-g*t+h*y-m*v)*G;d[12]=(-f*B+D*w-E*p)*G;d[13]=(j*B-b*w+c*p)*G;d[14]=(-r*z+l*J-A*v)*G;d[15]=(g*z-h*J+k*v)*G;return d},toRotationMat:function(a,d){d||(d=t.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d},toMat3:function(a,d){d||(d=x.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[4];d[4]=a[5];d[5]=a[6];d[6]=a[8];d[7]=a[9];d[8]=a[10]; +return d},toInverseMat3:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[4],f=a[5],D=a[6],g=a[8],s=a[9],h=a[10],k=h*f-D*s,m=-h*e+D*g,l=s*e-f*g,r=j*k+b*m+c*l;if(!r)return null;r=1/r;d||(d=x.create());d[0]=k*r;d[1]=(-h*b+c*s)*r;d[2]=(D*b-c*f)*r;d[3]=m*r;d[4]=(h*j-c*g)*r;d[5]=(-D*j+c*e)*r;d[6]=l*r;d[7]=(-s*j+b*g)*r;d[8]=(f*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],s=a[6],k=a[7],m=a[8],l=a[9],q=a[10],r=a[11],t=a[12],A=a[13],u=a[14];a=a[15];var v=d[0], +p=d[1],y=d[2],z=d[3];j[0]=v*b+p*g+y*m+z*t;j[1]=v*c+p*h+y*l+z*A;j[2]=v*e+p*s+y*q+z*u;j[3]=v*f+p*k+y*r+z*a;v=d[4];p=d[5];y=d[6];z=d[7];j[4]=v*b+p*g+y*m+z*t;j[5]=v*c+p*h+y*l+z*A;j[6]=v*e+p*s+y*q+z*u;j[7]=v*f+p*k+y*r+z*a;v=d[8];p=d[9];y=d[10];z=d[11];j[8]=v*b+p*g+y*m+z*t;j[9]=v*c+p*h+y*l+z*A;j[10]=v*e+p*s+y*q+z*u;j[11]=v*f+p*k+y*r+z*a;v=d[12];p=d[13];y=d[14];z=d[15];j[12]=v*b+p*g+y*m+z*t;j[13]=v*c+p*h+y*l+z*A;j[14]=v*e+p*s+y*q+z*u;j[15]=v*f+p*k+y*r+z*a;return j},multiplyVec3:function(a,d,b){b||(b=d); +var c=d[0],e=d[1];d=d[2];b[0]=a[0]*c+a[4]*e+a[8]*d+a[12];b[1]=a[1]*c+a[5]*e+a[9]*d+a[13];b[2]=a[2]*c+a[6]*e+a[10]*d+a[14];return b},multiplyVec4:function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=d[3];b[0]=a[0]*c+a[4]*e+a[8]*f+a[12]*d;b[1]=a[1]*c+a[5]*e+a[9]*f+a[13]*d;b[2]=a[2]*c+a[6]*e+a[10]*f+a[14]*d;b[3]=a[3]*c+a[7]*e+a[11]*f+a[15]*d;return b},translate:function(a,d,b){var c=d[0],e=d[1];d=d[2];var f,n,g,h,s,k,m,l,p,r,q,t;if(!b||a===b)return a[12]=a[0]*c+a[4]*e+a[8]*d+a[12],a[13]=a[1]*c+a[5]*e+ +a[9]*d+a[13],a[14]=a[2]*c+a[6]*e+a[10]*d+a[14],a[15]=a[3]*c+a[7]*e+a[11]*d+a[15],a;f=a[0];n=a[1];g=a[2];h=a[3];s=a[4];k=a[5];m=a[6];l=a[7];p=a[8];r=a[9];q=a[10];t=a[11];b[0]=f;b[1]=n;b[2]=g;b[3]=h;b[4]=s;b[5]=k;b[6]=m;b[7]=l;b[8]=p;b[9]=r;b[10]=q;b[11]=t;b[12]=f*c+s*e+p*d+a[12];b[13]=n*c+k*e+r*d+a[13];b[14]=g*c+m*e+q*d+a[14];b[15]=h*c+l*e+t*d+a[15];return b},scale:function(a,d,b){var c=d[0],e=d[1];d=d[2];if(!b||a===b)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=d,a[9]*= +d,a[10]*=d,a[11]*=d,a;b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[7]=a[7]*e;b[8]=a[8]*d;b[9]=a[9]*d;b[10]=a[10]*d;b[11]=a[11]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},rotate:function(a,d,b,c){var e=b[0],f=b[1];b=b[2];var n=Math.sqrt(e*e+f*f+b*b),g,h,k,m,l,p,q,r,t,u,w,v,x,y,z,B,C,F,H,K;if(!n)return null;1!==n&&(n=1/n,e*=n,f*=n,b*=n);g=Math.sin(d);h=Math.cos(d);k=1-h;d=a[0];n=a[1];m=a[2];l=a[3];p=a[4];q=a[5];r=a[6];t=a[7];u=a[8];w=a[9];v= +a[10];x=a[11];y=e*e*k+h;z=f*e*k+b*g;B=b*e*k-f*g;C=e*f*k-b*g;F=f*f*k+h;H=b*f*k+e*g;K=e*b*k+f*g;e=f*b*k-e*g;f=b*b*k+h;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=d*y+p*z+u*B;c[1]=n*y+q*z+w*B;c[2]=m*y+r*z+v*B;c[3]=l*y+t*z+x*B;c[4]=d*C+p*F+u*H;c[5]=n*C+q*F+w*H;c[6]=m*C+r*F+v*H;c[7]=l*C+t*F+x*H;c[8]=d*K+p*e+u*f;c[9]=n*K+q*e+w*f;c[10]=m*K+r*e+v*f;c[11]=l*K+t*e+x*f;return c},rotateX:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[4],f=a[5],n=a[6],g=a[7],h=a[8],k=a[9],m=a[10], +l=a[11];b?a!==b&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[4]=e*d+h*c;b[5]=f*d+k*c;b[6]=n*d+m*c;b[7]=g*d+l*c;b[8]=e*-c+h*d;b[9]=f*-c+k*d;b[10]=n*-c+m*d;b[11]=g*-c+l*d;return b},rotateY:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[8],k=a[9],m=a[10],l=a[11];b?a!==b&&(b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*-c;b[1]=f*d+k*-c;b[2]=n*d+m*-c;b[3]=g* +d+l*-c;b[8]=e*c+h*d;b[9]=f*c+k*d;b[10]=n*c+m*d;b[11]=g*c+l*d;return b},rotateZ:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[4],k=a[5],m=a[6],l=a[7];b?a!==b&&(b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*c;b[1]=f*d+k*c;b[2]=n*d+m*c;b[3]=g*d+l*c;b[4]=e*-c+h*d;b[5]=f*-c+k*d;b[6]=n*-c+m*d;b[7]=g*-c+l*d;return b},frustum:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2*e/g;n[1]=0; +n[2]=0;n[3]=0;n[4]=0;n[5]=2*e/h;n[6]=0;n[7]=0;n[8]=(d+a)/g;n[9]=(c+b)/h;n[10]=-(f+e)/k;n[11]=-1;n[12]=0;n[13]=0;n[14]=-(2*f*e)/k;n[15]=0;return n},perspective:function(a,d,b,c,e){a=b*Math.tan(a*Math.PI/360);d*=a;return t.frustum(-d,d,-a,a,b,c,e)},ortho:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2/g;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=2/h;n[6]=0;n[7]=0;n[8]=0;n[9]=0;n[10]=-2/k;n[11]=0;n[12]=-(a+d)/g;n[13]=-(c+b)/h;n[14]=-(f+e)/k;n[15]=1;return n},lookAt:function(a,d,b,c){c|| +(c=t.create());var e,f,n,g,h,k,m,l,p=a[0],q=a[1];a=a[2];n=b[0];g=b[1];f=b[2];m=d[0];b=d[1];e=d[2];if(p===m&&q===b&&a===e)return t.identity(c);d=p-m;b=q-b;m=a-e;l=1/Math.sqrt(d*d+b*b+m*m);d*=l;b*=l;m*=l;e=g*m-f*b;f=f*d-n*m;n=n*b-g*d;(l=Math.sqrt(e*e+f*f+n*n))?(l=1/l,e*=l,f*=l,n*=l):n=f=e=0;g=b*n-m*f;h=m*e-d*n;k=d*f-b*e;(l=Math.sqrt(g*g+h*h+k*k))?(l=1/l,g*=l,h*=l,k*=l):k=h=g=0;c[0]=e;c[1]=g;c[2]=d;c[3]=0;c[4]=f;c[5]=h;c[6]=b;c[7]=0;c[8]=n;c[9]=k;c[10]=m;c[11]=0;c[12]=-(e*p+f*q+n*a);c[13]=-(g*p+h*q+ +k*a);c[14]=-(d*p+b*q+m*a);c[15]=1;return c},fromRotationTranslation:function(a,d,b){b||(b=t.create());var c=a[0],e=a[1],f=a[2],n=a[3],g=c+c,h=e+e,k=f+f;a=c*g;var l=c*h,c=c*k,m=e*h,e=e*k,f=f*k,g=n*g,h=n*h,n=n*k;b[0]=1-(m+f);b[1]=l+n;b[2]=c-h;b[3]=0;b[4]=l-n;b[5]=1-(a+f);b[6]=e+g;b[7]=0;b[8]=c+h;b[9]=e-g;b[10]=1-(a+m);b[11]=0;b[12]=d[0];b[13]=d[1];b[14]=d[2];b[15]=1;return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ +a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},m={create:function(a){var d=new k(4);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]):d[0]=d[1]=d[2]=d[3]=0;return d},createFrom:function(a,d,b,c){var e=new k(4);e[0]=a;e[1]=d;e[2]=b;e[3]=c;return e},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])},identity:function(a){a||(a=m.create()); +a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},H=m.identity();m.calculateW=function(a,d){var b=a[0],c=a[1],e=a[2];if(!d||a===d)return a[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e)),a;d[0]=b;d[1]=c;d[2]=e;d[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e));return d};m.dot=function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3]};m.inverse=function(a,d){var b=a[0],c=a[1],e=a[2],f=a[3],b=(b=b*b+c*c+e*e+f*f)?1/b:0;if(!d||a===d)return a[0]*=-b,a[1]*=-b,a[2]*=-b,a[3]*=b,a;d[0]=-a[0]*b;d[1]=-a[1]*b;d[2]=-a[2]*b;d[3]=a[3]*b; +return d};m.conjugate=function(a,d){if(!d||a===d)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=a[3];return d};m.length=function(a){var d=a[0],b=a[1],c=a[2];a=a[3];return Math.sqrt(d*d+b*b+c*c+a*a)};m.normalize=function(a,d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=Math.sqrt(b*b+c*c+e*e+f*f);if(0===g)return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d;g=1/g;d[0]=b*g;d[1]=c*g;d[2]=e*g;d[3]=f*g;return d};m.add=function(a,d,b){if(!b||a===b)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a[3]+= +d[3],a;b[0]=a[0]+d[0];b[1]=a[1]+d[1];b[2]=a[2]+d[2];b[3]=a[3]+d[3];return b};m.multiply=function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2];a=a[3];var g=d[0],h=d[1],k=d[2];d=d[3];b[0]=c*d+a*g+e*k-f*h;b[1]=e*d+a*h+f*g-c*k;b[2]=f*d+a*k+c*h-e*g;b[3]=a*d-c*g-e*h-f*k;return b};m.multiplyVec3=function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=a[0];var g=a[1],h=a[2];a=a[3];var k=a*c+g*f-h*e,l=a*e+h*c-d*f,m=a*f+d*e-g*c,c=-d*c-g*e-h*f;b[0]=k*a+c*-d+l*-h-m*-g;b[1]=l*a+c*-g+m*-d-k*-h;b[2]=m*a+c*-h+k*-g-l*-d; +return b};m.scale=function(a,d,b){if(!b||a===b)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a;b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[3]=a[3]*d;return b};m.toMat3=function(a,d){d||(d=x.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b*k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=m-f;d[4]=1-(l+e);d[5]=c+g;d[6]=b+h;d[7]=c-g;d[8]=1-(l+p);return d};m.toMat4=function(a,d){d||(d=t.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b* +k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=0;d[4]=m-f;d[5]=1-(l+e);d[6]=c+g;d[7]=0;d[8]=b+h;d[9]=c-g;d[10]=1-(l+p);d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d};m.slerp=function(a,d,b,c){c||(c=a);var e=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3],f,g;if(1<=Math.abs(e))return c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]),c;f=Math.acos(e);g=Math.sqrt(1-e*e);if(0.0010>Math.abs(g))return c[0]=0.5*a[0]+0.5*d[0],c[1]=0.5*a[1]+0.5*d[1],c[2]=0.5*a[2]+0.5*d[2],c[3]=0.5*a[3]+ +0.5*d[3],c;e=Math.sin((1-b)*f)/g;b=Math.sin(b*f)/g;c[0]=a[0]*e+d[0]*b;c[1]=a[1]*e+d[1]*b;c[2]=a[2]*e+d[2]*b;c[3]=a[3]*e+d[3]*b;return c};m.fromRotationMatrix=function(a,d){d||(d=m.create());var b=a[0]+a[4]+a[8],c;if(0a[0]&&(b=1);a[8]>a[3*b+b]&&(b=2);var e=c[b],f=c[e];c=Math.sqrt(a[3*b+b]-a[3*e+e]-a[3*f+f]+1);d[b]=0.5*c;c= +0.5/c;d[3]=(a[3*f+e]-a[3*e+f])*c;d[e]=(a[3*e+b]+a[3*b+e])*c;d[f]=(a[3*f+b]+a[3*b+f])*c}return d};x.toQuat4=m.fromRotationMatrix;var B=x.create();m.fromAxes=function(a,d,b,c){B[0]=d[0];B[3]=d[1];B[6]=d[2];B[1]=b[0];B[4]=b[1];B[7]=b[2];B[2]=a[0];B[5]=a[1];B[8]=a[2];return m.fromRotationMatrix(B,c)};m.identity=function(a){a||(a=m.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};m.fromAngleAxis=function(a,d,b){b||(b=m.create());a*=0.5;var c=Math.sin(a);b[3]=Math.cos(a);b[0]=c*d[0];b[1]=c*d[1];b[2]=c*d[2]; +return b};m.toAngleAxis=function(a,d){d||(d=a);var b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); +b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 +Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],e=a[1],f=a[2],g=a[3],h=c*g-f*e;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-e*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, +b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];c[0]=e*b[0]+f*b[2];c[1]=e*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=e*b+f*h;c[1]=e*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var e=b[0];b=b[1];c[0]=e*a[0]+b*a[1];c[1]=e*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var e=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=e*b;c[2]=f*h;c[3]= +g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, +b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| +(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= +f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; +PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; +PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/examples/bunny benchmark/index.html b/examples/bunny benchmark/index.html index 7c5521b..95972c4 100644 --- a/examples/bunny benchmark/index.html +++ b/examples/bunny benchmark/index.html @@ -9,9 +9,10 @@ +
    Click to add more bunnys! Let me know how many you get on screen here @doormat23
    - + diff --git a/examples/bunny benchmark/js/bunnyBenchMark.js b/examples/bunny benchmark/js/bunnyBenchMark.js index a3154eb..c3c8ec5 100644 --- a/examples/bunny benchmark/js/bunnyBenchMark.js +++ b/examples/bunny benchmark/js/bunnyBenchMark.js @@ -22,18 +22,13 @@ var count = 0; var container; +var detail; + function onReady() { - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() + detail = document.getElementById("pixi"); - if(webgl) - { - renderer = new PIXI.WebGLRenderer(); - } - else - { - renderer = new PIXI.CanvasRenderer(480, 320); - } + renderer = PIXI.autoDetectRenderer(); stage = new PIXI.Stage; @@ -46,7 +41,7 @@ stats.domElement.style.top = "0px"; requestAnimFrame(update); - wabbitTexture = new PIXI.Texture("wabbit.png") + wabbitTexture = new PIXI.Texture.fromImage("wabbit.png") counter = document.createElement("div"); counter.className = "counter"; @@ -55,7 +50,6 @@ count = startBunnyCount; counter.innerHTML = count + " BUNNIES"; - container = new PIXI.DisplayObjectContainer(); stage.addChild(container); @@ -114,7 +108,9 @@ minX = 0; maxY = height; minY = 0; - + + detail.style.left = width - 204 + "px"; + detail.style.top = height - 100 + "px"; renderer.resize(width, height); } @@ -126,17 +122,17 @@ { // add 10 at a time :) - for (var i = 0; i < 2; i++) + for (var i = 0; i < 10; i++) { - var bunny = new PIXI.Sprite(wabbitTexture, {x:0, y:0, width:26, height:37}); + var bunny = new PIXI.Sprite(wabbitTexture); bunny.speedX = Math.random() * 10; bunny.speedY = (Math.random() * 10) - 5; bunny.anchor.x = 0.5; bunny.anchor.y = 1; - bunny.alpha = 0.3 + Math.random() * 0.7; + //bunny.alpha = 0.3 + Math.random() * 0.7; bunnys.push(bunny); - bunny.rotation = Math.random() - 0.5; + //bunny.rotation = Math.random() - 0.5; container.addChild(bunny); count++; diff --git a/examples/bunny benchmark/js/pixi.js b/examples/bunny benchmark/js/pixi.js new file mode 100644 index 0000000..65add09 --- /dev/null +++ b/examples/bunny benchmark/js/pixi.js @@ -0,0 +1,110 @@ +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, +d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* +j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= +a[0]-d[0],c=a[1]-d[1];a=a[2]-d[2];d=Math.sqrt(b*b+c*c+a*a);if(!d)return j[0]=0,j[1]=0,j[2]=0,j;d=1/d;j[0]=b*d;j[1]=c*d;j[2]=a*d;return j},lerp:function(a,d,j,b){b||(b=a);b[0]=a[0]+j*(d[0]-a[0]);b[1]=a[1]+j*(d[1]-a[1]);b[2]=a[2]+j*(d[2]-a[2]);return b},dist:function(a,d){var j=d[0]-a[0],b=d[1]-a[1],c=d[2]-a[2];return Math.sqrt(j*j+b*b+c*c)}},p=null,q=new k(4);l.unproject=function(a,d,j,b,c){c||(c=a);p||(p=t.create());var e=p;q[0]=2*(a[0]-b[0])/b[2]-1;q[1]=2*(a[1]-b[1])/b[3]-1;q[2]=2*a[2]-1;q[3]=1; +t.multiply(j,d,e);if(!t.inverse(e))return null;t.multiplyVec4(e,q);if(0===q[3])return null;c[0]=q[0]/q[3];c[1]=q[1]/q[3];c[2]=q[2]/q[3];return c};var C=l.createFrom(1,0,0),F=l.createFrom(0,1,0),u=l.createFrom(0,0,1),w=l.create();l.rotationTo=function(a,d,j){j||(j=m.create());var b=l.dot(a,d);if(1<=b)m.set(H,j);else if(-0.999999>b)l.cross(C,a,w),1E-6>l.length(w)&&l.cross(F,a,w),1E-6>l.length(w)&&l.cross(u,a,w),l.normalize(w),m.fromAngleAxis(Math.PI,w,j);else{var b=Math.sqrt(2*(1+b)),c=1/b;l.cross(a, +d,w);j[0]=w[0]*c;j[1]=w[1]*c;j[2]=w[2]*c;j[3]=0.5*b;m.normalize(j)}1j[3]&&(j[3]=-1);return j};l.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var x={create:function(a){var d=new k(9);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8]):d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=0;return d},createFrom:function(a,d,j,b,c,e,n,f,E){var s=new k(9);s[0]=a;s[1]=d;s[2]=j;s[3]=b;s[4]=c;s[5]=e;s[6]=n;s[7]=f;s[8]=E;return s},determinant:function(a){var d= +a[3],j=a[4],b=a[5],c=a[6],e=a[7],n=a[8];return a[0]*(n*j-b*e)+a[1]*(-n*d+b*c)+a[2]*(e*d-j*c)},inverse:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[3],n=a[4],f=a[5],E=a[6],s=a[7],I=a[8],g=I*n-f*s,h=-I*e+f*E,k=s*e-n*E,r=j*g+b*h+c*k;if(!r)return null;r=1/r;d||(d=x.create());d[0]=g*r;d[1]=(-I*b+c*s)*r;d[2]=(f*b-c*n)*r;d[3]=h*r;d[4]=(I*j-c*E)*r;d[5]=(-f*j+c*e)*r;d[6]=k*r;d[7]=(-s*j+b*E)*r;d[8]=(n*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],D=a[4],E=a[5],s=a[6],I= +a[7];a=a[8];var g=d[0],h=d[1],k=d[2],r=d[3],m=d[4],l=d[5],q=d[6],v=d[7];d=d[8];j[0]=g*b+h*f+k*s;j[1]=g*c+h*D+k*I;j[2]=g*e+h*E+k*a;j[3]=r*b+m*f+l*s;j[4]=r*c+m*D+l*I;j[5]=r*e+m*E+l*a;j[6]=q*b+v*f+d*s;j[7]=q*c+v*D+d*I;j[8]=q*e+v*E+d*a;return j},multiplyVec2:function(a,d,j){j||(j=d);var b=d[0];d=d[1];j[0]=b*a[0]+d*a[3]+a[6];j[1]=b*a[1]+d*a[4]+a[7];return j},multiplyVec3:function(a,d,j){j||(j=d);var b=d[0],c=d[1];d=d[2];j[0]=b*a[0]+c*a[3]+d*a[6];j[1]=b*a[1]+c*a[4]+d*a[7];j[2]=b*a[2]+c*a[5]+d*a[8];return j}, +set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])},identity:function(a){a||(a=x.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, +d){if(!d||a===d){var j=a[1],b=a[2],c=a[5];a[1]=a[3];a[2]=a[6];a[3]=j;a[5]=a[7];a[6]=b;a[7]=c;return a}d[0]=a[0];d[1]=a[3];d[2]=a[6];d[3]=a[1];d[4]=a[4];d[5]=a[7];d[6]=a[2];d[7]=a[5];d[8]=a[8];return d},toMat4:function(a,d){d||(d=t.create());d[15]=1;d[14]=0;d[13]=0;d[12]=0;d[11]=0;d[10]=a[8];d[9]=a[7];d[8]=a[6];d[7]=0;d[6]=a[5];d[5]=a[4];d[4]=a[3];d[3]=0;d[2]=a[2];d[1]=a[1];d[0]=a[0];return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ +a[8]+"]"}},t={create:function(a){var d=new k(16);a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8],d[9]=a[9],d[10]=a[10],d[11]=a[11],d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d},createFrom:function(a,d,j,b,c,e,f,D,E,s,g,h,m,l,r,q){var A=new k(16);A[0]=a;A[1]=d;A[2]=j;A[3]=b;A[4]=c;A[5]=e;A[6]=f;A[7]=D;A[8]=E;A[9]=s;A[10]=g;A[11]=h;A[12]=m;A[13]=l;A[14]=r;A[15]=q;return A},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4]; +d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=a[12];d[13]=a[13];d[14]=a[14];d[15]=a[15];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])&&1E-6>Math.abs(a[9]-d[9])&&1E-6>Math.abs(a[10]-d[10])&&1E-6>Math.abs(a[11]-d[11])&&1E-6>Math.abs(a[12]- +d[12])&&1E-6>Math.abs(a[13]-d[13])&&1E-6>Math.abs(a[14]-d[14])&&1E-6>Math.abs(a[15]-d[15])},identity:function(a){a||(a=t.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,d){if(!d||a===d){var j=a[1],b=a[2],c=a[3],e=a[6],f=a[7],D=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=j;a[6]=a[9];a[7]=a[13];a[8]=b;a[9]=e;a[11]=a[14];a[12]=c;a[13]=f;a[14]=D;return a}d[0]=a[0];d[1]=a[4];d[2]=a[8];d[3]=a[12]; +d[4]=a[1];d[5]=a[5];d[6]=a[9];d[7]=a[13];d[8]=a[2];d[9]=a[6];d[10]=a[10];d[11]=a[14];d[12]=a[3];d[13]=a[7];d[14]=a[11];d[15]=a[15];return d},determinant:function(a){var d=a[0],j=a[1],b=a[2],c=a[3],e=a[4],f=a[5],D=a[6],E=a[7],s=a[8],g=a[9],h=a[10],k=a[11],m=a[12],r=a[13],l=a[14];a=a[15];return m*g*D*c-s*r*D*c-m*f*h*c+e*r*h*c+s*f*l*c-e*g*l*c-m*g*b*E+s*r*b*E+m*j*h*E-d*r*h*E-s*j*l*E+d*g*l*E+m*f*b*k-e*r*b*k-m*j*D*k+d*r*D*k+e*j*l*k-d*f*l*k-s*f*b*a+e*g*b*a+s*j*D*a-d*g*D*a-e*j*h*a+d*f*h*a},inverse:function(a, +d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=a[3],f=a[4],D=a[5],E=a[6],s=a[7],g=a[8],h=a[9],k=a[10],m=a[11],r=a[12],l=a[13],A=a[14],q=a[15],v=j*D-b*f,J=j*E-c*f,y=j*s-e*f,z=b*E-c*D,t=b*s-e*D,u=c*s-e*E,p=g*l-h*r,w=g*A-k*r,x=g*q-m*r,B=h*A-k*l,C=h*q-m*l,F=k*q-m*A,G=v*F-J*C+y*B+z*x-t*w+u*p;if(!G)return null;G=1/G;d[0]=(D*F-E*C+s*B)*G;d[1]=(-b*F+c*C-e*B)*G;d[2]=(l*u-A*t+q*z)*G;d[3]=(-h*u+k*t-m*z)*G;d[4]=(-f*F+E*x-s*w)*G;d[5]=(j*F-c*x+e*w)*G;d[6]=(-r*u+A*y-q*J)*G;d[7]=(g*u-k*y+m*J)*G;d[8]=(f*C-D*x+s*p)*G;d[9]= +(-j*C+b*x-e*p)*G;d[10]=(r*t-l*y+q*v)*G;d[11]=(-g*t+h*y-m*v)*G;d[12]=(-f*B+D*w-E*p)*G;d[13]=(j*B-b*w+c*p)*G;d[14]=(-r*z+l*J-A*v)*G;d[15]=(g*z-h*J+k*v)*G;return d},toRotationMat:function(a,d){d||(d=t.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d},toMat3:function(a,d){d||(d=x.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[4];d[4]=a[5];d[5]=a[6];d[6]=a[8];d[7]=a[9];d[8]=a[10]; +return d},toInverseMat3:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[4],f=a[5],D=a[6],g=a[8],s=a[9],h=a[10],k=h*f-D*s,m=-h*e+D*g,l=s*e-f*g,r=j*k+b*m+c*l;if(!r)return null;r=1/r;d||(d=x.create());d[0]=k*r;d[1]=(-h*b+c*s)*r;d[2]=(D*b-c*f)*r;d[3]=m*r;d[4]=(h*j-c*g)*r;d[5]=(-D*j+c*e)*r;d[6]=l*r;d[7]=(-s*j+b*g)*r;d[8]=(f*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],s=a[6],k=a[7],m=a[8],l=a[9],q=a[10],r=a[11],t=a[12],A=a[13],u=a[14];a=a[15];var v=d[0], +p=d[1],y=d[2],z=d[3];j[0]=v*b+p*g+y*m+z*t;j[1]=v*c+p*h+y*l+z*A;j[2]=v*e+p*s+y*q+z*u;j[3]=v*f+p*k+y*r+z*a;v=d[4];p=d[5];y=d[6];z=d[7];j[4]=v*b+p*g+y*m+z*t;j[5]=v*c+p*h+y*l+z*A;j[6]=v*e+p*s+y*q+z*u;j[7]=v*f+p*k+y*r+z*a;v=d[8];p=d[9];y=d[10];z=d[11];j[8]=v*b+p*g+y*m+z*t;j[9]=v*c+p*h+y*l+z*A;j[10]=v*e+p*s+y*q+z*u;j[11]=v*f+p*k+y*r+z*a;v=d[12];p=d[13];y=d[14];z=d[15];j[12]=v*b+p*g+y*m+z*t;j[13]=v*c+p*h+y*l+z*A;j[14]=v*e+p*s+y*q+z*u;j[15]=v*f+p*k+y*r+z*a;return j},multiplyVec3:function(a,d,b){b||(b=d); +var c=d[0],e=d[1];d=d[2];b[0]=a[0]*c+a[4]*e+a[8]*d+a[12];b[1]=a[1]*c+a[5]*e+a[9]*d+a[13];b[2]=a[2]*c+a[6]*e+a[10]*d+a[14];return b},multiplyVec4:function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=d[3];b[0]=a[0]*c+a[4]*e+a[8]*f+a[12]*d;b[1]=a[1]*c+a[5]*e+a[9]*f+a[13]*d;b[2]=a[2]*c+a[6]*e+a[10]*f+a[14]*d;b[3]=a[3]*c+a[7]*e+a[11]*f+a[15]*d;return b},translate:function(a,d,b){var c=d[0],e=d[1];d=d[2];var f,n,g,h,s,k,m,l,p,r,q,t;if(!b||a===b)return a[12]=a[0]*c+a[4]*e+a[8]*d+a[12],a[13]=a[1]*c+a[5]*e+ +a[9]*d+a[13],a[14]=a[2]*c+a[6]*e+a[10]*d+a[14],a[15]=a[3]*c+a[7]*e+a[11]*d+a[15],a;f=a[0];n=a[1];g=a[2];h=a[3];s=a[4];k=a[5];m=a[6];l=a[7];p=a[8];r=a[9];q=a[10];t=a[11];b[0]=f;b[1]=n;b[2]=g;b[3]=h;b[4]=s;b[5]=k;b[6]=m;b[7]=l;b[8]=p;b[9]=r;b[10]=q;b[11]=t;b[12]=f*c+s*e+p*d+a[12];b[13]=n*c+k*e+r*d+a[13];b[14]=g*c+m*e+q*d+a[14];b[15]=h*c+l*e+t*d+a[15];return b},scale:function(a,d,b){var c=d[0],e=d[1];d=d[2];if(!b||a===b)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=d,a[9]*= +d,a[10]*=d,a[11]*=d,a;b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[7]=a[7]*e;b[8]=a[8]*d;b[9]=a[9]*d;b[10]=a[10]*d;b[11]=a[11]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},rotate:function(a,d,b,c){var e=b[0],f=b[1];b=b[2];var n=Math.sqrt(e*e+f*f+b*b),g,h,k,m,l,p,q,r,t,u,w,v,x,y,z,B,C,F,H,K;if(!n)return null;1!==n&&(n=1/n,e*=n,f*=n,b*=n);g=Math.sin(d);h=Math.cos(d);k=1-h;d=a[0];n=a[1];m=a[2];l=a[3];p=a[4];q=a[5];r=a[6];t=a[7];u=a[8];w=a[9];v= +a[10];x=a[11];y=e*e*k+h;z=f*e*k+b*g;B=b*e*k-f*g;C=e*f*k-b*g;F=f*f*k+h;H=b*f*k+e*g;K=e*b*k+f*g;e=f*b*k-e*g;f=b*b*k+h;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=d*y+p*z+u*B;c[1]=n*y+q*z+w*B;c[2]=m*y+r*z+v*B;c[3]=l*y+t*z+x*B;c[4]=d*C+p*F+u*H;c[5]=n*C+q*F+w*H;c[6]=m*C+r*F+v*H;c[7]=l*C+t*F+x*H;c[8]=d*K+p*e+u*f;c[9]=n*K+q*e+w*f;c[10]=m*K+r*e+v*f;c[11]=l*K+t*e+x*f;return c},rotateX:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[4],f=a[5],n=a[6],g=a[7],h=a[8],k=a[9],m=a[10], +l=a[11];b?a!==b&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[4]=e*d+h*c;b[5]=f*d+k*c;b[6]=n*d+m*c;b[7]=g*d+l*c;b[8]=e*-c+h*d;b[9]=f*-c+k*d;b[10]=n*-c+m*d;b[11]=g*-c+l*d;return b},rotateY:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[8],k=a[9],m=a[10],l=a[11];b?a!==b&&(b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*-c;b[1]=f*d+k*-c;b[2]=n*d+m*-c;b[3]=g* +d+l*-c;b[8]=e*c+h*d;b[9]=f*c+k*d;b[10]=n*c+m*d;b[11]=g*c+l*d;return b},rotateZ:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[4],k=a[5],m=a[6],l=a[7];b?a!==b&&(b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*c;b[1]=f*d+k*c;b[2]=n*d+m*c;b[3]=g*d+l*c;b[4]=e*-c+h*d;b[5]=f*-c+k*d;b[6]=n*-c+m*d;b[7]=g*-c+l*d;return b},frustum:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2*e/g;n[1]=0; +n[2]=0;n[3]=0;n[4]=0;n[5]=2*e/h;n[6]=0;n[7]=0;n[8]=(d+a)/g;n[9]=(c+b)/h;n[10]=-(f+e)/k;n[11]=-1;n[12]=0;n[13]=0;n[14]=-(2*f*e)/k;n[15]=0;return n},perspective:function(a,d,b,c,e){a=b*Math.tan(a*Math.PI/360);d*=a;return t.frustum(-d,d,-a,a,b,c,e)},ortho:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2/g;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=2/h;n[6]=0;n[7]=0;n[8]=0;n[9]=0;n[10]=-2/k;n[11]=0;n[12]=-(a+d)/g;n[13]=-(c+b)/h;n[14]=-(f+e)/k;n[15]=1;return n},lookAt:function(a,d,b,c){c|| +(c=t.create());var e,f,n,g,h,k,m,l,p=a[0],q=a[1];a=a[2];n=b[0];g=b[1];f=b[2];m=d[0];b=d[1];e=d[2];if(p===m&&q===b&&a===e)return t.identity(c);d=p-m;b=q-b;m=a-e;l=1/Math.sqrt(d*d+b*b+m*m);d*=l;b*=l;m*=l;e=g*m-f*b;f=f*d-n*m;n=n*b-g*d;(l=Math.sqrt(e*e+f*f+n*n))?(l=1/l,e*=l,f*=l,n*=l):n=f=e=0;g=b*n-m*f;h=m*e-d*n;k=d*f-b*e;(l=Math.sqrt(g*g+h*h+k*k))?(l=1/l,g*=l,h*=l,k*=l):k=h=g=0;c[0]=e;c[1]=g;c[2]=d;c[3]=0;c[4]=f;c[5]=h;c[6]=b;c[7]=0;c[8]=n;c[9]=k;c[10]=m;c[11]=0;c[12]=-(e*p+f*q+n*a);c[13]=-(g*p+h*q+ +k*a);c[14]=-(d*p+b*q+m*a);c[15]=1;return c},fromRotationTranslation:function(a,d,b){b||(b=t.create());var c=a[0],e=a[1],f=a[2],n=a[3],g=c+c,h=e+e,k=f+f;a=c*g;var l=c*h,c=c*k,m=e*h,e=e*k,f=f*k,g=n*g,h=n*h,n=n*k;b[0]=1-(m+f);b[1]=l+n;b[2]=c-h;b[3]=0;b[4]=l-n;b[5]=1-(a+f);b[6]=e+g;b[7]=0;b[8]=c+h;b[9]=e-g;b[10]=1-(a+m);b[11]=0;b[12]=d[0];b[13]=d[1];b[14]=d[2];b[15]=1;return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ +a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},m={create:function(a){var d=new k(4);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]):d[0]=d[1]=d[2]=d[3]=0;return d},createFrom:function(a,d,b,c){var e=new k(4);e[0]=a;e[1]=d;e[2]=b;e[3]=c;return e},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])},identity:function(a){a||(a=m.create()); +a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},H=m.identity();m.calculateW=function(a,d){var b=a[0],c=a[1],e=a[2];if(!d||a===d)return a[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e)),a;d[0]=b;d[1]=c;d[2]=e;d[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e));return d};m.dot=function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3]};m.inverse=function(a,d){var b=a[0],c=a[1],e=a[2],f=a[3],b=(b=b*b+c*c+e*e+f*f)?1/b:0;if(!d||a===d)return a[0]*=-b,a[1]*=-b,a[2]*=-b,a[3]*=b,a;d[0]=-a[0]*b;d[1]=-a[1]*b;d[2]=-a[2]*b;d[3]=a[3]*b; +return d};m.conjugate=function(a,d){if(!d||a===d)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=a[3];return d};m.length=function(a){var d=a[0],b=a[1],c=a[2];a=a[3];return Math.sqrt(d*d+b*b+c*c+a*a)};m.normalize=function(a,d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=Math.sqrt(b*b+c*c+e*e+f*f);if(0===g)return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d;g=1/g;d[0]=b*g;d[1]=c*g;d[2]=e*g;d[3]=f*g;return d};m.add=function(a,d,b){if(!b||a===b)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a[3]+= +d[3],a;b[0]=a[0]+d[0];b[1]=a[1]+d[1];b[2]=a[2]+d[2];b[3]=a[3]+d[3];return b};m.multiply=function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2];a=a[3];var g=d[0],h=d[1],k=d[2];d=d[3];b[0]=c*d+a*g+e*k-f*h;b[1]=e*d+a*h+f*g-c*k;b[2]=f*d+a*k+c*h-e*g;b[3]=a*d-c*g-e*h-f*k;return b};m.multiplyVec3=function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=a[0];var g=a[1],h=a[2];a=a[3];var k=a*c+g*f-h*e,l=a*e+h*c-d*f,m=a*f+d*e-g*c,c=-d*c-g*e-h*f;b[0]=k*a+c*-d+l*-h-m*-g;b[1]=l*a+c*-g+m*-d-k*-h;b[2]=m*a+c*-h+k*-g-l*-d; +return b};m.scale=function(a,d,b){if(!b||a===b)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a;b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[3]=a[3]*d;return b};m.toMat3=function(a,d){d||(d=x.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b*k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=m-f;d[4]=1-(l+e);d[5]=c+g;d[6]=b+h;d[7]=c-g;d[8]=1-(l+p);return d};m.toMat4=function(a,d){d||(d=t.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b* +k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=0;d[4]=m-f;d[5]=1-(l+e);d[6]=c+g;d[7]=0;d[8]=b+h;d[9]=c-g;d[10]=1-(l+p);d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d};m.slerp=function(a,d,b,c){c||(c=a);var e=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3],f,g;if(1<=Math.abs(e))return c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]),c;f=Math.acos(e);g=Math.sqrt(1-e*e);if(0.0010>Math.abs(g))return c[0]=0.5*a[0]+0.5*d[0],c[1]=0.5*a[1]+0.5*d[1],c[2]=0.5*a[2]+0.5*d[2],c[3]=0.5*a[3]+ +0.5*d[3],c;e=Math.sin((1-b)*f)/g;b=Math.sin(b*f)/g;c[0]=a[0]*e+d[0]*b;c[1]=a[1]*e+d[1]*b;c[2]=a[2]*e+d[2]*b;c[3]=a[3]*e+d[3]*b;return c};m.fromRotationMatrix=function(a,d){d||(d=m.create());var b=a[0]+a[4]+a[8],c;if(0a[0]&&(b=1);a[8]>a[3*b+b]&&(b=2);var e=c[b],f=c[e];c=Math.sqrt(a[3*b+b]-a[3*e+e]-a[3*f+f]+1);d[b]=0.5*c;c= +0.5/c;d[3]=(a[3*f+e]-a[3*e+f])*c;d[e]=(a[3*e+b]+a[3*b+e])*c;d[f]=(a[3*f+b]+a[3*b+f])*c}return d};x.toQuat4=m.fromRotationMatrix;var B=x.create();m.fromAxes=function(a,d,b,c){B[0]=d[0];B[3]=d[1];B[6]=d[2];B[1]=b[0];B[4]=b[1];B[7]=b[2];B[2]=a[0];B[5]=a[1];B[8]=a[2];return m.fromRotationMatrix(B,c)};m.identity=function(a){a||(a=m.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};m.fromAngleAxis=function(a,d,b){b||(b=m.create());a*=0.5;var c=Math.sin(a);b[3]=Math.cos(a);b[0]=c*d[0];b[1]=c*d[1];b[2]=c*d[2]; +return b};m.toAngleAxis=function(a,d){d||(d=a);var b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); +b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 +Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],e=a[1],f=a[2],g=a[3],h=c*g-f*e;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-e*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, +b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];c[0]=e*b[0]+f*b[2];c[1]=e*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=e*b+f*h;c[1]=e*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var e=b[0];b=b[1];c[0]=e*a[0]+b*a[1];c[1]=e*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var e=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=e*b;c[2]=f*h;c[3]= +g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, +b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| +(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= +f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; +PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; +PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l>1);var b=m[0];return b*(1.5-0.5*a*b*b)}}else g.invsqrt=function(a){return 1/Math.sqrt(a)}; -var l=null;f();var j={create:function(a){var b=new l(3);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0;return b},createFrom:function(a,b,e){var c=new l(3);c[0]=a;c[1]=b;c[2]=e;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])},add:function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];return e},subtract:function(a, -b,e){if(!e||a===e)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];return e},multiply:function(a,b,e){if(!e||a===e)return a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a;e[0]=a[0]*b[0];e[1]=a[1]*b[1];e[2]=a[2]*b[2];return e},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;return e},normalize:function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=Math.sqrt(e* -e+c*c+d*d);if(!k)return b[0]=0,b[1]=0,b[2]=0,b;if(1===k)return b[0]=e,b[1]=c,b[2]=d,b;k=1/k;b[0]=e*k;b[1]=c*k;b[2]=d*k;return b},cross:function(a,b,e){e||(e=a);var c=a[0],d=a[1];a=a[2];var k=b[0],h=b[1];b=b[2];e[0]=d*b-a*h;e[1]=a*k-c*b;e[2]=c*h-d*k;return e},length:function(a){var b=a[0],e=a[1];a=a[2];return Math.sqrt(b*b+e*e+a*a)},squaredLength:function(a){var b=a[0],e=a[1];a=a[2];return b*b+e*e+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,b,e){e||(e=a);var c= -a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];b=Math.sqrt(c*c+d*d+a*a);if(!b)return e[0]=0,e[1]=0,e[2]=0,e;b=1/b;e[0]=c*b;e[1]=d*b;e[2]=a*b;return e},lerp:function(a,b,e,c){c||(c=a);c[0]=a[0]+e*(b[0]-a[0]);c[1]=a[1]+e*(b[1]-a[1]);c[2]=a[2]+e*(b[2]-a[2]);return c},dist:function(a,b){var e=b[0]-a[0],c=b[1]-a[1],d=b[2]-a[2];return Math.sqrt(e*e+c*c+d*d)}},x=null,n=new l(4);j.unproject=function(a,b,e,c,d){d||(d=a);x||(x=y.create());var k=x;n[0]=2*(a[0]-c[0])/c[2]-1;n[1]=2*(a[1]-c[1])/c[3]-1;n[2]=2*a[2]-1;n[3]=1; -y.multiply(e,b,k);if(!y.inverse(k))return null;y.multiplyVec4(k,n);if(0===n[3])return null;d[0]=n[0]/n[3];d[1]=n[1]/n[3];d[2]=n[2]/n[3];return d};var z=j.createFrom(1,0,0),A=j.createFrom(0,1,0),H=j.createFrom(0,0,1),C=j.create();j.rotationTo=function(a,b,e){e||(e=s.create());var c=j.dot(a,b);if(1<=c)s.set(O,e);else if(-0.999999>c)j.cross(z,a,C),1E-6>j.length(C)&&j.cross(A,a,C),1E-6>j.length(C)&&j.cross(H,a,C),j.normalize(C),s.fromAngleAxis(Math.PI,C,e);else{var c=Math.sqrt(2*(1+c)),d=1/c;j.cross(a, -b,C);e[0]=C[0]*d;e[1]=C[1]*d;e[2]=C[2]*d;e[3]=0.5*c;s.normalize(e)}1e[3]&&(e[3]=-1);return e};j.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var F={create:function(a){var b=new l(9);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0;return b},createFrom:function(a,b,e,c,d,k,h,E,K){var q=new l(9);q[0]=a;q[1]=b;q[2]=e;q[3]=c;q[4]=d;q[5]=k;q[6]=h;q[7]=E;q[8]=K;return q},determinant:function(a){var b= -a[3],e=a[4],c=a[5],d=a[6],k=a[7],h=a[8];return a[0]*(h*e-c*k)+a[1]*(-h*b+c*d)+a[2]*(k*b-e*d)},inverse:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],E=a[5],K=a[6],q=a[7],f=a[8],g=f*h-E*q,j=-f*k+E*K,J=q*k-h*K,r=e*g+c*j+d*J;if(!r)return null;r=1/r;b||(b=F.create());b[0]=g*r;b[1]=(-f*c+d*q)*r;b[2]=(E*c-d*h)*r;b[3]=j*r;b[4]=(f*e-d*K)*r;b[5]=(-E*e+d*k)*r;b[6]=J*r;b[7]=(-q*e+c*K)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],E=a[4],f=a[5],q=a[6],g= -a[7];a=a[8];var u=b[0],j=b[1],J=b[2],r=b[3],l=b[4],t=b[5],m=b[6],p=b[7];b=b[8];e[0]=u*c+j*h+J*q;e[1]=u*d+j*E+J*g;e[2]=u*k+j*f+J*a;e[3]=r*c+l*h+t*q;e[4]=r*d+l*E+t*g;e[5]=r*k+l*f+t*a;e[6]=m*c+p*h+b*q;e[7]=m*d+p*E+b*g;e[8]=m*k+p*f+b*a;return e},multiplyVec2:function(a,b,e){e||(e=b);var c=b[0];b=b[1];e[0]=c*a[0]+b*a[3]+a[6];e[1]=c*a[1]+b*a[4]+a[7];return e},multiplyVec3:function(a,b,e){e||(e=b);var c=b[0],d=b[1];b=b[2];e[0]=c*a[0]+d*a[3]+b*a[6];e[1]=c*a[1]+d*a[4]+b*a[7];e[2]=c*a[2]+d*a[5]+b*a[8];return e}, -set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])},identity:function(a){a||(a=F.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, -b){if(!b||a===b){var e=a[1],c=a[2],d=a[5];a[1]=a[3];a[2]=a[6];a[3]=e;a[5]=a[7];a[6]=c;a[7]=d;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]=a[8];return b},toMat4:function(a,b){b||(b=y.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ -a[8]+"]"}},y={create:function(a){var b=new l(16);a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]);return b},createFrom:function(a,b,e,c,d,k,h,E,f,q,g,u,j,J,r,m){var t=new l(16);t[0]=a;t[1]=b;t[2]=e;t[3]=c;t[4]=d;t[5]=k;t[6]=h;t[7]=E;t[8]=f;t[9]=q;t[10]=g;t[11]=u;t[12]=j;t[13]=J;t[14]=r;t[15]=m;return t},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4]; -b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])&&1E-6>Math.abs(a[9]-b[9])&&1E-6>Math.abs(a[10]-b[10])&&1E-6>Math.abs(a[11]-b[11])&&1E-6>Math.abs(a[12]- -b[12])&&1E-6>Math.abs(a[13]-b[13])&&1E-6>Math.abs(a[14]-b[14])&&1E-6>Math.abs(a[15]-b[15])},identity:function(a){a||(a=y.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){var e=a[1],c=a[2],d=a[3],k=a[6],h=a[7],E=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=e;a[6]=a[9];a[7]=a[13];a[8]=c;a[9]=k;a[11]=a[14];a[12]=d;a[13]=h;a[14]=E;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12]; -b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b=a[0],e=a[1],c=a[2],d=a[3],k=a[4],h=a[5],E=a[6],f=a[7],g=a[8],I=a[9],u=a[10],j=a[11],l=a[12],r=a[13],m=a[14];a=a[15];return l*I*E*d-g*r*E*d-l*h*u*d+k*r*u*d+g*h*m*d-k*I*m*d-l*I*c*f+g*r*c*f+l*e*u*f-b*r*u*f-g*e*m*f+b*I*m*f+l*h*c*j-k*r*c*j-l*e*E*j+b*r*E*j+k*e*m*j-b*h*m*j-g*h*c*a+k*I*c*a+g*e*E*a-b*I*E*a-k*e*u*a+b*h*u*a},inverse:function(a, -b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],f=a[5],g=a[6],q=a[7],I=a[8],u=a[9],j=a[10],l=a[11],r=a[12],m=a[13],t=a[14],p=a[15],s=e*f-c*h,n=e*g-d*h,v=e*q-k*h,w=c*g-d*f,x=c*q-k*f,y=d*q-k*g,z=I*m-u*r,A=I*t-j*r,C=I*p-l*r,D=u*t-j*m,F=u*p-l*m,H=j*p-l*t,G=s*H-n*F+v*D+w*C-x*A+y*z;if(!G)return null;G=1/G;b[0]=(f*H-g*F+q*D)*G;b[1]=(-c*H+d*F-k*D)*G;b[2]=(m*y-t*x+p*w)*G;b[3]=(-u*y+j*x-l*w)*G;b[4]=(-h*H+g*C-q*A)*G;b[5]=(e*H-d*C+k*A)*G;b[6]=(-r*y+t*v-p*n)*G;b[7]=(I*y-j*v+l*n)*G;b[8]=(h*F-f*C+q*z)*G;b[9]= -(-e*F+c*C-k*z)*G;b[10]=(r*x-m*v+p*s)*G;b[11]=(-I*x+u*v-l*s)*G;b[12]=(-h*D+f*A-g*z)*G;b[13]=(e*D-c*A+d*z)*G;b[14]=(-r*w+m*n-t*s)*G;b[15]=(I*w-u*n+j*s)*G;return b},toRotationMat:function(a,b){b||(b=y.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=F.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10]; -return b},toInverseMat3:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[4],h=a[5],f=a[6],g=a[8],q=a[9],j=a[10],u=j*h-f*q,l=-j*k+f*g,m=q*k-h*g,r=e*u+c*l+d*m;if(!r)return null;r=1/r;b||(b=F.create());b[0]=u*r;b[1]=(-j*c+d*q)*r;b[2]=(f*c-d*h)*r;b[3]=l*r;b[4]=(j*e-d*g)*r;b[5]=(-f*e+d*k)*r;b[6]=m*r;b[7]=(-q*e+c*g)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],f=a[4],g=a[5],q=a[6],j=a[7],u=a[8],l=a[9],m=a[10],r=a[11],p=a[12],t=a[13],s=a[14];a=a[15];var n=b[0], -B=b[1],v=b[2],w=b[3];e[0]=n*c+B*f+v*u+w*p;e[1]=n*d+B*g+v*l+w*t;e[2]=n*k+B*q+v*m+w*s;e[3]=n*h+B*j+v*r+w*a;n=b[4];B=b[5];v=b[6];w=b[7];e[4]=n*c+B*f+v*u+w*p;e[5]=n*d+B*g+v*l+w*t;e[6]=n*k+B*q+v*m+w*s;e[7]=n*h+B*j+v*r+w*a;n=b[8];B=b[9];v=b[10];w=b[11];e[8]=n*c+B*f+v*u+w*p;e[9]=n*d+B*g+v*l+w*t;e[10]=n*k+B*q+v*m+w*s;e[11]=n*h+B*j+v*r+w*a;n=b[12];B=b[13];v=b[14];w=b[15];e[12]=n*c+B*f+v*u+w*p;e[13]=n*d+B*g+v*l+w*t;e[14]=n*k+B*q+v*m+w*s;e[15]=n*h+B*j+v*r+w*a;return e},multiplyVec3:function(a,b,e){e||(e=b); -var c=b[0],d=b[1];b=b[2];e[0]=a[0]*c+a[4]*d+a[8]*b+a[12];e[1]=a[1]*c+a[5]*d+a[9]*b+a[13];e[2]=a[2]*c+a[6]*d+a[10]*b+a[14];return e},multiplyVec4:function(a,b,e){e||(e=b);var c=b[0],d=b[1],k=b[2];b=b[3];e[0]=a[0]*c+a[4]*d+a[8]*k+a[12]*b;e[1]=a[1]*c+a[5]*d+a[9]*k+a[13]*b;e[2]=a[2]*c+a[6]*d+a[10]*k+a[14]*b;e[3]=a[3]*c+a[7]*d+a[11]*k+a[15]*b;return e},translate:function(a,b,e){var c=b[0],d=b[1];b=b[2];var k,h,f,g,q,j,u,l,m,n,p,s;if(!e||a===e)return a[12]=a[0]*c+a[4]*d+a[8]*b+a[12],a[13]=a[1]*c+a[5]*d+ -a[9]*b+a[13],a[14]=a[2]*c+a[6]*d+a[10]*b+a[14],a[15]=a[3]*c+a[7]*d+a[11]*b+a[15],a;k=a[0];h=a[1];f=a[2];g=a[3];q=a[4];j=a[5];u=a[6];l=a[7];m=a[8];n=a[9];p=a[10];s=a[11];e[0]=k;e[1]=h;e[2]=f;e[3]=g;e[4]=q;e[5]=j;e[6]=u;e[7]=l;e[8]=m;e[9]=n;e[10]=p;e[11]=s;e[12]=k*c+q*d+m*b+a[12];e[13]=h*c+j*d+n*b+a[13];e[14]=f*c+u*d+p*b+a[14];e[15]=g*c+l*d+s*b+a[15];return e},scale:function(a,b,e){var c=b[0],d=b[1];b=b[2];if(!e||a===e)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=d,a[5]*=d,a[6]*=d,a[7]*=d,a[8]*=b,a[9]*= -b,a[10]*=b,a[11]*=b,a;e[0]=a[0]*c;e[1]=a[1]*c;e[2]=a[2]*c;e[3]=a[3]*c;e[4]=a[4]*d;e[5]=a[5]*d;e[6]=a[6]*d;e[7]=a[7]*d;e[8]=a[8]*b;e[9]=a[9]*b;e[10]=a[10]*b;e[11]=a[11]*b;e[12]=a[12];e[13]=a[13];e[14]=a[14];e[15]=a[15];return e},rotate:function(a,b,e,c){var d=e[0],k=e[1];e=e[2];var h=Math.sqrt(d*d+k*k+e*e),f,g,q,j,l,m,n,r,p,s,x,y,B,v,w,z,A,C,D,F;if(!h)return null;1!==h&&(h=1/h,d*=h,k*=h,e*=h);f=Math.sin(b);g=Math.cos(b);q=1-g;b=a[0];h=a[1];j=a[2];l=a[3];m=a[4];n=a[5];r=a[6];p=a[7];s=a[8];x=a[9];y= -a[10];B=a[11];v=d*d*q+g;w=k*d*q+e*f;z=e*d*q-k*f;A=d*k*q-e*f;C=k*k*q+g;D=e*k*q+d*f;F=d*e*q+k*f;d=k*e*q-d*f;k=e*e*q+g;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=b*v+m*w+s*z;c[1]=h*v+n*w+x*z;c[2]=j*v+r*w+y*z;c[3]=l*v+p*w+B*z;c[4]=b*A+m*C+s*D;c[5]=h*A+n*C+x*D;c[6]=j*A+r*C+y*D;c[7]=l*A+p*C+B*D;c[8]=b*F+m*d+s*k;c[9]=h*F+n*d+x*k;c[10]=j*F+r*d+y*k;c[11]=l*F+p*d+B*k;return c},rotateX:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[4],k=a[5],h=a[6],f=a[7],g=a[8],q=a[9],j=a[10], -l=a[11];e?a!==e&&(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[4]=d*b+g*c;e[5]=k*b+q*c;e[6]=h*b+j*c;e[7]=f*b+l*c;e[8]=d*-c+g*b;e[9]=k*-c+q*b;e[10]=h*-c+j*b;e[11]=f*-c+l*b;return e},rotateY:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[8],j=a[9],l=a[10],m=a[11];e?a!==e&&(e[4]=a[4],e[5]=a[5],e[6]=a[6],e[7]=a[7],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*-c;e[1]=k*b+j*-c;e[2]=h*b+l*-c;e[3]=f* -b+m*-c;e[8]=d*c+g*b;e[9]=k*c+j*b;e[10]=h*c+l*b;e[11]=f*c+m*b;return e},rotateZ:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[4],j=a[5],l=a[6],m=a[7];e?a!==e&&(e[8]=a[8],e[9]=a[9],e[10]=a[10],e[11]=a[11],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*c;e[1]=k*b+j*c;e[2]=h*b+l*c;e[3]=f*b+m*c;e[4]=d*-c+g*b;e[5]=k*-c+j*b;e[6]=h*-c+l*b;e[7]=f*-c+m*b;return e},frustum:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2*d/f;h[1]=0; -h[2]=0;h[3]=0;h[4]=0;h[5]=2*d/g;h[6]=0;h[7]=0;h[8]=(b+a)/f;h[9]=(c+e)/g;h[10]=-(k+d)/j;h[11]=-1;h[12]=0;h[13]=0;h[14]=-(2*k*d)/j;h[15]=0;return h},perspective:function(a,b,e,c,d){a=e*Math.tan(a*Math.PI/360);b*=a;return y.frustum(-b,b,-a,a,e,c,d)},ortho:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2/f;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/g;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/j;h[11]=0;h[12]=-(a+b)/f;h[13]=-(c+e)/g;h[14]=-(k+d)/j;h[15]=1;return h},lookAt:function(a,b,e,c){c|| -(c=y.create());var d,k,h,f,g,j,l,m,n=a[0],p=a[1];a=a[2];h=e[0];f=e[1];k=e[2];l=b[0];e=b[1];d=b[2];if(n===l&&p===e&&a===d)return y.identity(c);b=n-l;e=p-e;l=a-d;m=1/Math.sqrt(b*b+e*e+l*l);b*=m;e*=m;l*=m;d=f*l-k*e;k=k*b-h*l;h=h*e-f*b;(m=Math.sqrt(d*d+k*k+h*h))?(m=1/m,d*=m,k*=m,h*=m):h=k=d=0;f=e*h-l*k;g=l*d-b*h;j=b*k-e*d;(m=Math.sqrt(f*f+g*g+j*j))?(m=1/m,f*=m,g*=m,j*=m):j=g=f=0;c[0]=d;c[1]=f;c[2]=b;c[3]=0;c[4]=k;c[5]=g;c[6]=e;c[7]=0;c[8]=h;c[9]=j;c[10]=l;c[11]=0;c[12]=-(d*n+k*p+h*a);c[13]=-(f*n+g*p+ -j*a);c[14]=-(b*n+e*p+l*a);c[15]=1;return c},fromRotationTranslation:function(a,b,e){e||(e=y.create());var c=a[0],d=a[1],k=a[2],h=a[3],f=c+c,g=d+d,j=k+k;a=c*f;var l=c*g,c=c*j,m=d*g,d=d*j,k=k*j,f=h*f,g=h*g,h=h*j;e[0]=1-(m+k);e[1]=l+h;e[2]=c-g;e[3]=0;e[4]=l-h;e[5]=1-(a+k);e[6]=d+f;e[7]=0;e[8]=c+g;e[9]=d-f;e[10]=1-(a+m);e[11]=0;e[12]=b[0];e[13]=b[1];e[14]=b[2];e[15]=1;return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ -a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},s={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,e,c){var d=new l(4);d[0]=a;d[1]=b;d[2]=e;d[3]=c;return d},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=s.create()); -a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},O=s.identity();s.calculateW=function(a,b){var e=a[0],c=a[1],d=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d)),a;b[0]=e;b[1]=c;b[2]=d;b[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d));return b};s.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};s.inverse=function(a,b){var e=a[0],c=a[1],d=a[2],f=a[3],e=(e=e*e+c*c+d*d+f*f)?1/e:0;if(!b||a===b)return a[0]*=-e,a[1]*=-e,a[2]*=-e,a[3]*=e,a;b[0]=-a[0]*e;b[1]=-a[1]*e;b[2]=-a[2]*e;b[3]=a[3]*e; -return b};s.conjugate=function(a,b){if(!b||a===b)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};s.length=function(a){var b=a[0],e=a[1],c=a[2];a=a[3];return Math.sqrt(b*b+e*e+c*c+a*a)};s.normalize=function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],f=a[3],h=Math.sqrt(e*e+c*c+d*d+f*f);if(0===h)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;h=1/h;b[0]=e*h;b[1]=c*h;b[2]=d*h;b[3]=f*h;return b};s.add=function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+= -b[3],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];e[3]=a[3]+b[3];return e};s.multiply=function(a,b,e){e||(e=a);var c=a[0],d=a[1],f=a[2];a=a[3];var h=b[0],g=b[1],j=b[2];b=b[3];e[0]=c*b+a*h+d*j-f*g;e[1]=d*b+a*g+f*h-c*j;e[2]=f*b+a*j+c*g-d*h;e[3]=a*b-c*h-d*g-f*j;return e};s.multiplyVec3=function(a,b,e){e||(e=b);var c=b[0],d=b[1],f=b[2];b=a[0];var h=a[1],g=a[2];a=a[3];var j=a*c+h*f-g*d,l=a*d+g*c-b*f,m=a*f+b*d-h*c,c=-b*c-h*d-g*f;e[0]=j*a+c*-b+l*-g-m*-h;e[1]=l*a+c*-h+m*-b-j*-g;e[2]=m*a+c*-g+j*-h-l*-b; -return e};s.scale=function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a[3]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;e[3]=a[3]*b;return e};s.toMat3=function(a,b){b||(b=F.create());var e=a[0],c=a[1],d=a[2],f=a[3],h=e+e,g=c+c,j=d+d,l=e*h,m=e*g,e=e*j,n=c*g,c=c*j,d=d*j,h=f*h,g=f*g,f=f*j;b[0]=1-(n+d);b[1]=m+f;b[2]=e-g;b[3]=m-f;b[4]=1-(l+d);b[5]=c+h;b[6]=e+g;b[7]=c-h;b[8]=1-(l+n);return b};s.toMat4=function(a,b){b||(b=y.create());var e=a[0],c=a[1],d=a[2],f=a[3],g=e+e,j=c+c,l=d+d,m=e*g,n=e*j,e=e* -l,p=c*j,c=c*l,d=d*l,g=f*g,j=f*j,f=f*l;b[0]=1-(p+d);b[1]=n+f;b[2]=e-j;b[3]=0;b[4]=n-f;b[5]=1-(m+d);b[6]=c+g;b[7]=0;b[8]=e+j;b[9]=c-g;b[10]=1-(m+p);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};s.slerp=function(a,b,c,d){d||(d=a);var f=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],g,h;if(1<=Math.abs(f))return d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d;g=Math.acos(f);h=Math.sqrt(1-f*f);if(0.001>Math.abs(h))return d[0]=0.5*a[0]+0.5*b[0],d[1]=0.5*a[1]+0.5*b[1],d[2]=0.5*a[2]+0.5*b[2],d[3]=0.5*a[3]+ -0.5*b[3],d;f=Math.sin((1-c)*g)/h;c=Math.sin(c*g)/h;d[0]=a[0]*f+b[0]*c;d[1]=a[1]*f+b[1]*c;d[2]=a[2]*f+b[2]*c;d[3]=a[3]*f+b[3]*c;return d};s.fromRotationMatrix=function(a,b){b||(b=s.create());var c=a[0]+a[4]+a[8],d;if(0a[0]&&(c=1);a[8]>a[3*c+c]&&(c=2);var f=d[c],g=d[f];d=Math.sqrt(a[3*c+c]-a[3*f+f]-a[3*g+g]+1);b[c]=0.5*d;d= -0.5/d;b[3]=(a[3*g+f]-a[3*f+g])*d;b[f]=(a[3*f+c]+a[3*c+f])*d;b[g]=(a[3*g+c]+a[3*c+g])*d}return b};F.toQuat4=s.fromRotationMatrix;var D=F.create();s.fromAxes=function(a,b,c,d){D[0]=b[0];D[3]=b[1];D[6]=b[2];D[1]=c[0];D[4]=c[1];D[7]=c[2];D[2]=a[0];D[5]=a[1];D[8]=a[2];return s.fromRotationMatrix(D,d)};s.identity=function(a){a||(a=s.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};s.fromAngleAxis=function(a,b,c){c||(c=s.create());a*=0.5;var d=Math.sin(a);c[3]=Math.cos(a);c[0]=d*b[0];c[1]=d*b[1];c[2]=d*b[2]; -return c};s.toAngleAxis=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); -b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 -Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],f=a[2],g=a[3],h=c*g-f*d;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-d*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, -b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];c[0]=d*b[0]+f*b[2];c[1]=d*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=d*b+f*h;c[1]=d*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var d=b[0];b=b[1];c[0]=d*a[0]+b*a[1];c[1]=d*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var d=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=d*b;c[2]=f*h;c[3]= -g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,d){var f=new l(4);f[0]=a;f[1]=b;f[2]=c;f[3]=d;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, -b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| -(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)},squaredLength:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};c&&(c.glMatrixArrayType=l,c.MatrixArray=l,c.setMatrixArrayType=d,c.determineMatrixArrayType= -f,c.glMath=g,c.vec2=M,c.vec3=j,c.vec4=N,c.mat2=L,c.mat3=F,c.mat4=y,c.quat4=s);return{glMatrixArrayType:l,MatrixArray:l,setMatrixArrayType:d,determineMatrixArrayType:f,glMath:g,vec2:M,vec3:j,vec4:N,mat2:L,mat3:F,mat4:y,quat4:s}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * vColor;","}"]; -PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"]; -PIXI.CompileVertexShader=function(c,d){for(var f="",g=0;g>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/examples/bunny benchmark/index.html b/examples/bunny benchmark/index.html index 7c5521b..95972c4 100644 --- a/examples/bunny benchmark/index.html +++ b/examples/bunny benchmark/index.html @@ -9,9 +9,10 @@ +
    Click to add more bunnys! Let me know how many you get on screen here @doormat23
    - + diff --git a/examples/bunny benchmark/js/bunnyBenchMark.js b/examples/bunny benchmark/js/bunnyBenchMark.js index a3154eb..c3c8ec5 100644 --- a/examples/bunny benchmark/js/bunnyBenchMark.js +++ b/examples/bunny benchmark/js/bunnyBenchMark.js @@ -22,18 +22,13 @@ var count = 0; var container; +var detail; + function onReady() { - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() + detail = document.getElementById("pixi"); - if(webgl) - { - renderer = new PIXI.WebGLRenderer(); - } - else - { - renderer = new PIXI.CanvasRenderer(480, 320); - } + renderer = PIXI.autoDetectRenderer(); stage = new PIXI.Stage; @@ -46,7 +41,7 @@ stats.domElement.style.top = "0px"; requestAnimFrame(update); - wabbitTexture = new PIXI.Texture("wabbit.png") + wabbitTexture = new PIXI.Texture.fromImage("wabbit.png") counter = document.createElement("div"); counter.className = "counter"; @@ -55,7 +50,6 @@ count = startBunnyCount; counter.innerHTML = count + " BUNNIES"; - container = new PIXI.DisplayObjectContainer(); stage.addChild(container); @@ -114,7 +108,9 @@ minX = 0; maxY = height; minY = 0; - + + detail.style.left = width - 204 + "px"; + detail.style.top = height - 100 + "px"; renderer.resize(width, height); } @@ -126,17 +122,17 @@ { // add 10 at a time :) - for (var i = 0; i < 2; i++) + for (var i = 0; i < 10; i++) { - var bunny = new PIXI.Sprite(wabbitTexture, {x:0, y:0, width:26, height:37}); + var bunny = new PIXI.Sprite(wabbitTexture); bunny.speedX = Math.random() * 10; bunny.speedY = (Math.random() * 10) - 5; bunny.anchor.x = 0.5; bunny.anchor.y = 1; - bunny.alpha = 0.3 + Math.random() * 0.7; + //bunny.alpha = 0.3 + Math.random() * 0.7; bunnys.push(bunny); - bunny.rotation = Math.random() - 0.5; + //bunny.rotation = Math.random() - 0.5; container.addChild(bunny); count++; diff --git a/examples/bunny benchmark/js/pixi.js b/examples/bunny benchmark/js/pixi.js new file mode 100644 index 0000000..65add09 --- /dev/null +++ b/examples/bunny benchmark/js/pixi.js @@ -0,0 +1,110 @@ +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, +d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* +j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= +a[0]-d[0],c=a[1]-d[1];a=a[2]-d[2];d=Math.sqrt(b*b+c*c+a*a);if(!d)return j[0]=0,j[1]=0,j[2]=0,j;d=1/d;j[0]=b*d;j[1]=c*d;j[2]=a*d;return j},lerp:function(a,d,j,b){b||(b=a);b[0]=a[0]+j*(d[0]-a[0]);b[1]=a[1]+j*(d[1]-a[1]);b[2]=a[2]+j*(d[2]-a[2]);return b},dist:function(a,d){var j=d[0]-a[0],b=d[1]-a[1],c=d[2]-a[2];return Math.sqrt(j*j+b*b+c*c)}},p=null,q=new k(4);l.unproject=function(a,d,j,b,c){c||(c=a);p||(p=t.create());var e=p;q[0]=2*(a[0]-b[0])/b[2]-1;q[1]=2*(a[1]-b[1])/b[3]-1;q[2]=2*a[2]-1;q[3]=1; +t.multiply(j,d,e);if(!t.inverse(e))return null;t.multiplyVec4(e,q);if(0===q[3])return null;c[0]=q[0]/q[3];c[1]=q[1]/q[3];c[2]=q[2]/q[3];return c};var C=l.createFrom(1,0,0),F=l.createFrom(0,1,0),u=l.createFrom(0,0,1),w=l.create();l.rotationTo=function(a,d,j){j||(j=m.create());var b=l.dot(a,d);if(1<=b)m.set(H,j);else if(-0.999999>b)l.cross(C,a,w),1E-6>l.length(w)&&l.cross(F,a,w),1E-6>l.length(w)&&l.cross(u,a,w),l.normalize(w),m.fromAngleAxis(Math.PI,w,j);else{var b=Math.sqrt(2*(1+b)),c=1/b;l.cross(a, +d,w);j[0]=w[0]*c;j[1]=w[1]*c;j[2]=w[2]*c;j[3]=0.5*b;m.normalize(j)}1j[3]&&(j[3]=-1);return j};l.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var x={create:function(a){var d=new k(9);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8]):d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=0;return d},createFrom:function(a,d,j,b,c,e,n,f,E){var s=new k(9);s[0]=a;s[1]=d;s[2]=j;s[3]=b;s[4]=c;s[5]=e;s[6]=n;s[7]=f;s[8]=E;return s},determinant:function(a){var d= +a[3],j=a[4],b=a[5],c=a[6],e=a[7],n=a[8];return a[0]*(n*j-b*e)+a[1]*(-n*d+b*c)+a[2]*(e*d-j*c)},inverse:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[3],n=a[4],f=a[5],E=a[6],s=a[7],I=a[8],g=I*n-f*s,h=-I*e+f*E,k=s*e-n*E,r=j*g+b*h+c*k;if(!r)return null;r=1/r;d||(d=x.create());d[0]=g*r;d[1]=(-I*b+c*s)*r;d[2]=(f*b-c*n)*r;d[3]=h*r;d[4]=(I*j-c*E)*r;d[5]=(-f*j+c*e)*r;d[6]=k*r;d[7]=(-s*j+b*E)*r;d[8]=(n*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],D=a[4],E=a[5],s=a[6],I= +a[7];a=a[8];var g=d[0],h=d[1],k=d[2],r=d[3],m=d[4],l=d[5],q=d[6],v=d[7];d=d[8];j[0]=g*b+h*f+k*s;j[1]=g*c+h*D+k*I;j[2]=g*e+h*E+k*a;j[3]=r*b+m*f+l*s;j[4]=r*c+m*D+l*I;j[5]=r*e+m*E+l*a;j[6]=q*b+v*f+d*s;j[7]=q*c+v*D+d*I;j[8]=q*e+v*E+d*a;return j},multiplyVec2:function(a,d,j){j||(j=d);var b=d[0];d=d[1];j[0]=b*a[0]+d*a[3]+a[6];j[1]=b*a[1]+d*a[4]+a[7];return j},multiplyVec3:function(a,d,j){j||(j=d);var b=d[0],c=d[1];d=d[2];j[0]=b*a[0]+c*a[3]+d*a[6];j[1]=b*a[1]+c*a[4]+d*a[7];j[2]=b*a[2]+c*a[5]+d*a[8];return j}, +set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])},identity:function(a){a||(a=x.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, +d){if(!d||a===d){var j=a[1],b=a[2],c=a[5];a[1]=a[3];a[2]=a[6];a[3]=j;a[5]=a[7];a[6]=b;a[7]=c;return a}d[0]=a[0];d[1]=a[3];d[2]=a[6];d[3]=a[1];d[4]=a[4];d[5]=a[7];d[6]=a[2];d[7]=a[5];d[8]=a[8];return d},toMat4:function(a,d){d||(d=t.create());d[15]=1;d[14]=0;d[13]=0;d[12]=0;d[11]=0;d[10]=a[8];d[9]=a[7];d[8]=a[6];d[7]=0;d[6]=a[5];d[5]=a[4];d[4]=a[3];d[3]=0;d[2]=a[2];d[1]=a[1];d[0]=a[0];return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ +a[8]+"]"}},t={create:function(a){var d=new k(16);a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8],d[9]=a[9],d[10]=a[10],d[11]=a[11],d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d},createFrom:function(a,d,j,b,c,e,f,D,E,s,g,h,m,l,r,q){var A=new k(16);A[0]=a;A[1]=d;A[2]=j;A[3]=b;A[4]=c;A[5]=e;A[6]=f;A[7]=D;A[8]=E;A[9]=s;A[10]=g;A[11]=h;A[12]=m;A[13]=l;A[14]=r;A[15]=q;return A},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4]; +d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=a[12];d[13]=a[13];d[14]=a[14];d[15]=a[15];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])&&1E-6>Math.abs(a[9]-d[9])&&1E-6>Math.abs(a[10]-d[10])&&1E-6>Math.abs(a[11]-d[11])&&1E-6>Math.abs(a[12]- +d[12])&&1E-6>Math.abs(a[13]-d[13])&&1E-6>Math.abs(a[14]-d[14])&&1E-6>Math.abs(a[15]-d[15])},identity:function(a){a||(a=t.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,d){if(!d||a===d){var j=a[1],b=a[2],c=a[3],e=a[6],f=a[7],D=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=j;a[6]=a[9];a[7]=a[13];a[8]=b;a[9]=e;a[11]=a[14];a[12]=c;a[13]=f;a[14]=D;return a}d[0]=a[0];d[1]=a[4];d[2]=a[8];d[3]=a[12]; +d[4]=a[1];d[5]=a[5];d[6]=a[9];d[7]=a[13];d[8]=a[2];d[9]=a[6];d[10]=a[10];d[11]=a[14];d[12]=a[3];d[13]=a[7];d[14]=a[11];d[15]=a[15];return d},determinant:function(a){var d=a[0],j=a[1],b=a[2],c=a[3],e=a[4],f=a[5],D=a[6],E=a[7],s=a[8],g=a[9],h=a[10],k=a[11],m=a[12],r=a[13],l=a[14];a=a[15];return m*g*D*c-s*r*D*c-m*f*h*c+e*r*h*c+s*f*l*c-e*g*l*c-m*g*b*E+s*r*b*E+m*j*h*E-d*r*h*E-s*j*l*E+d*g*l*E+m*f*b*k-e*r*b*k-m*j*D*k+d*r*D*k+e*j*l*k-d*f*l*k-s*f*b*a+e*g*b*a+s*j*D*a-d*g*D*a-e*j*h*a+d*f*h*a},inverse:function(a, +d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=a[3],f=a[4],D=a[5],E=a[6],s=a[7],g=a[8],h=a[9],k=a[10],m=a[11],r=a[12],l=a[13],A=a[14],q=a[15],v=j*D-b*f,J=j*E-c*f,y=j*s-e*f,z=b*E-c*D,t=b*s-e*D,u=c*s-e*E,p=g*l-h*r,w=g*A-k*r,x=g*q-m*r,B=h*A-k*l,C=h*q-m*l,F=k*q-m*A,G=v*F-J*C+y*B+z*x-t*w+u*p;if(!G)return null;G=1/G;d[0]=(D*F-E*C+s*B)*G;d[1]=(-b*F+c*C-e*B)*G;d[2]=(l*u-A*t+q*z)*G;d[3]=(-h*u+k*t-m*z)*G;d[4]=(-f*F+E*x-s*w)*G;d[5]=(j*F-c*x+e*w)*G;d[6]=(-r*u+A*y-q*J)*G;d[7]=(g*u-k*y+m*J)*G;d[8]=(f*C-D*x+s*p)*G;d[9]= +(-j*C+b*x-e*p)*G;d[10]=(r*t-l*y+q*v)*G;d[11]=(-g*t+h*y-m*v)*G;d[12]=(-f*B+D*w-E*p)*G;d[13]=(j*B-b*w+c*p)*G;d[14]=(-r*z+l*J-A*v)*G;d[15]=(g*z-h*J+k*v)*G;return d},toRotationMat:function(a,d){d||(d=t.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d},toMat3:function(a,d){d||(d=x.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[4];d[4]=a[5];d[5]=a[6];d[6]=a[8];d[7]=a[9];d[8]=a[10]; +return d},toInverseMat3:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[4],f=a[5],D=a[6],g=a[8],s=a[9],h=a[10],k=h*f-D*s,m=-h*e+D*g,l=s*e-f*g,r=j*k+b*m+c*l;if(!r)return null;r=1/r;d||(d=x.create());d[0]=k*r;d[1]=(-h*b+c*s)*r;d[2]=(D*b-c*f)*r;d[3]=m*r;d[4]=(h*j-c*g)*r;d[5]=(-D*j+c*e)*r;d[6]=l*r;d[7]=(-s*j+b*g)*r;d[8]=(f*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],s=a[6],k=a[7],m=a[8],l=a[9],q=a[10],r=a[11],t=a[12],A=a[13],u=a[14];a=a[15];var v=d[0], +p=d[1],y=d[2],z=d[3];j[0]=v*b+p*g+y*m+z*t;j[1]=v*c+p*h+y*l+z*A;j[2]=v*e+p*s+y*q+z*u;j[3]=v*f+p*k+y*r+z*a;v=d[4];p=d[5];y=d[6];z=d[7];j[4]=v*b+p*g+y*m+z*t;j[5]=v*c+p*h+y*l+z*A;j[6]=v*e+p*s+y*q+z*u;j[7]=v*f+p*k+y*r+z*a;v=d[8];p=d[9];y=d[10];z=d[11];j[8]=v*b+p*g+y*m+z*t;j[9]=v*c+p*h+y*l+z*A;j[10]=v*e+p*s+y*q+z*u;j[11]=v*f+p*k+y*r+z*a;v=d[12];p=d[13];y=d[14];z=d[15];j[12]=v*b+p*g+y*m+z*t;j[13]=v*c+p*h+y*l+z*A;j[14]=v*e+p*s+y*q+z*u;j[15]=v*f+p*k+y*r+z*a;return j},multiplyVec3:function(a,d,b){b||(b=d); +var c=d[0],e=d[1];d=d[2];b[0]=a[0]*c+a[4]*e+a[8]*d+a[12];b[1]=a[1]*c+a[5]*e+a[9]*d+a[13];b[2]=a[2]*c+a[6]*e+a[10]*d+a[14];return b},multiplyVec4:function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=d[3];b[0]=a[0]*c+a[4]*e+a[8]*f+a[12]*d;b[1]=a[1]*c+a[5]*e+a[9]*f+a[13]*d;b[2]=a[2]*c+a[6]*e+a[10]*f+a[14]*d;b[3]=a[3]*c+a[7]*e+a[11]*f+a[15]*d;return b},translate:function(a,d,b){var c=d[0],e=d[1];d=d[2];var f,n,g,h,s,k,m,l,p,r,q,t;if(!b||a===b)return a[12]=a[0]*c+a[4]*e+a[8]*d+a[12],a[13]=a[1]*c+a[5]*e+ +a[9]*d+a[13],a[14]=a[2]*c+a[6]*e+a[10]*d+a[14],a[15]=a[3]*c+a[7]*e+a[11]*d+a[15],a;f=a[0];n=a[1];g=a[2];h=a[3];s=a[4];k=a[5];m=a[6];l=a[7];p=a[8];r=a[9];q=a[10];t=a[11];b[0]=f;b[1]=n;b[2]=g;b[3]=h;b[4]=s;b[5]=k;b[6]=m;b[7]=l;b[8]=p;b[9]=r;b[10]=q;b[11]=t;b[12]=f*c+s*e+p*d+a[12];b[13]=n*c+k*e+r*d+a[13];b[14]=g*c+m*e+q*d+a[14];b[15]=h*c+l*e+t*d+a[15];return b},scale:function(a,d,b){var c=d[0],e=d[1];d=d[2];if(!b||a===b)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=d,a[9]*= +d,a[10]*=d,a[11]*=d,a;b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[7]=a[7]*e;b[8]=a[8]*d;b[9]=a[9]*d;b[10]=a[10]*d;b[11]=a[11]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},rotate:function(a,d,b,c){var e=b[0],f=b[1];b=b[2];var n=Math.sqrt(e*e+f*f+b*b),g,h,k,m,l,p,q,r,t,u,w,v,x,y,z,B,C,F,H,K;if(!n)return null;1!==n&&(n=1/n,e*=n,f*=n,b*=n);g=Math.sin(d);h=Math.cos(d);k=1-h;d=a[0];n=a[1];m=a[2];l=a[3];p=a[4];q=a[5];r=a[6];t=a[7];u=a[8];w=a[9];v= +a[10];x=a[11];y=e*e*k+h;z=f*e*k+b*g;B=b*e*k-f*g;C=e*f*k-b*g;F=f*f*k+h;H=b*f*k+e*g;K=e*b*k+f*g;e=f*b*k-e*g;f=b*b*k+h;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=d*y+p*z+u*B;c[1]=n*y+q*z+w*B;c[2]=m*y+r*z+v*B;c[3]=l*y+t*z+x*B;c[4]=d*C+p*F+u*H;c[5]=n*C+q*F+w*H;c[6]=m*C+r*F+v*H;c[7]=l*C+t*F+x*H;c[8]=d*K+p*e+u*f;c[9]=n*K+q*e+w*f;c[10]=m*K+r*e+v*f;c[11]=l*K+t*e+x*f;return c},rotateX:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[4],f=a[5],n=a[6],g=a[7],h=a[8],k=a[9],m=a[10], +l=a[11];b?a!==b&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[4]=e*d+h*c;b[5]=f*d+k*c;b[6]=n*d+m*c;b[7]=g*d+l*c;b[8]=e*-c+h*d;b[9]=f*-c+k*d;b[10]=n*-c+m*d;b[11]=g*-c+l*d;return b},rotateY:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[8],k=a[9],m=a[10],l=a[11];b?a!==b&&(b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*-c;b[1]=f*d+k*-c;b[2]=n*d+m*-c;b[3]=g* +d+l*-c;b[8]=e*c+h*d;b[9]=f*c+k*d;b[10]=n*c+m*d;b[11]=g*c+l*d;return b},rotateZ:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[4],k=a[5],m=a[6],l=a[7];b?a!==b&&(b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*c;b[1]=f*d+k*c;b[2]=n*d+m*c;b[3]=g*d+l*c;b[4]=e*-c+h*d;b[5]=f*-c+k*d;b[6]=n*-c+m*d;b[7]=g*-c+l*d;return b},frustum:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2*e/g;n[1]=0; +n[2]=0;n[3]=0;n[4]=0;n[5]=2*e/h;n[6]=0;n[7]=0;n[8]=(d+a)/g;n[9]=(c+b)/h;n[10]=-(f+e)/k;n[11]=-1;n[12]=0;n[13]=0;n[14]=-(2*f*e)/k;n[15]=0;return n},perspective:function(a,d,b,c,e){a=b*Math.tan(a*Math.PI/360);d*=a;return t.frustum(-d,d,-a,a,b,c,e)},ortho:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2/g;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=2/h;n[6]=0;n[7]=0;n[8]=0;n[9]=0;n[10]=-2/k;n[11]=0;n[12]=-(a+d)/g;n[13]=-(c+b)/h;n[14]=-(f+e)/k;n[15]=1;return n},lookAt:function(a,d,b,c){c|| +(c=t.create());var e,f,n,g,h,k,m,l,p=a[0],q=a[1];a=a[2];n=b[0];g=b[1];f=b[2];m=d[0];b=d[1];e=d[2];if(p===m&&q===b&&a===e)return t.identity(c);d=p-m;b=q-b;m=a-e;l=1/Math.sqrt(d*d+b*b+m*m);d*=l;b*=l;m*=l;e=g*m-f*b;f=f*d-n*m;n=n*b-g*d;(l=Math.sqrt(e*e+f*f+n*n))?(l=1/l,e*=l,f*=l,n*=l):n=f=e=0;g=b*n-m*f;h=m*e-d*n;k=d*f-b*e;(l=Math.sqrt(g*g+h*h+k*k))?(l=1/l,g*=l,h*=l,k*=l):k=h=g=0;c[0]=e;c[1]=g;c[2]=d;c[3]=0;c[4]=f;c[5]=h;c[6]=b;c[7]=0;c[8]=n;c[9]=k;c[10]=m;c[11]=0;c[12]=-(e*p+f*q+n*a);c[13]=-(g*p+h*q+ +k*a);c[14]=-(d*p+b*q+m*a);c[15]=1;return c},fromRotationTranslation:function(a,d,b){b||(b=t.create());var c=a[0],e=a[1],f=a[2],n=a[3],g=c+c,h=e+e,k=f+f;a=c*g;var l=c*h,c=c*k,m=e*h,e=e*k,f=f*k,g=n*g,h=n*h,n=n*k;b[0]=1-(m+f);b[1]=l+n;b[2]=c-h;b[3]=0;b[4]=l-n;b[5]=1-(a+f);b[6]=e+g;b[7]=0;b[8]=c+h;b[9]=e-g;b[10]=1-(a+m);b[11]=0;b[12]=d[0];b[13]=d[1];b[14]=d[2];b[15]=1;return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ +a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},m={create:function(a){var d=new k(4);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]):d[0]=d[1]=d[2]=d[3]=0;return d},createFrom:function(a,d,b,c){var e=new k(4);e[0]=a;e[1]=d;e[2]=b;e[3]=c;return e},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])},identity:function(a){a||(a=m.create()); +a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},H=m.identity();m.calculateW=function(a,d){var b=a[0],c=a[1],e=a[2];if(!d||a===d)return a[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e)),a;d[0]=b;d[1]=c;d[2]=e;d[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e));return d};m.dot=function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3]};m.inverse=function(a,d){var b=a[0],c=a[1],e=a[2],f=a[3],b=(b=b*b+c*c+e*e+f*f)?1/b:0;if(!d||a===d)return a[0]*=-b,a[1]*=-b,a[2]*=-b,a[3]*=b,a;d[0]=-a[0]*b;d[1]=-a[1]*b;d[2]=-a[2]*b;d[3]=a[3]*b; +return d};m.conjugate=function(a,d){if(!d||a===d)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=a[3];return d};m.length=function(a){var d=a[0],b=a[1],c=a[2];a=a[3];return Math.sqrt(d*d+b*b+c*c+a*a)};m.normalize=function(a,d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=Math.sqrt(b*b+c*c+e*e+f*f);if(0===g)return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d;g=1/g;d[0]=b*g;d[1]=c*g;d[2]=e*g;d[3]=f*g;return d};m.add=function(a,d,b){if(!b||a===b)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a[3]+= +d[3],a;b[0]=a[0]+d[0];b[1]=a[1]+d[1];b[2]=a[2]+d[2];b[3]=a[3]+d[3];return b};m.multiply=function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2];a=a[3];var g=d[0],h=d[1],k=d[2];d=d[3];b[0]=c*d+a*g+e*k-f*h;b[1]=e*d+a*h+f*g-c*k;b[2]=f*d+a*k+c*h-e*g;b[3]=a*d-c*g-e*h-f*k;return b};m.multiplyVec3=function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=a[0];var g=a[1],h=a[2];a=a[3];var k=a*c+g*f-h*e,l=a*e+h*c-d*f,m=a*f+d*e-g*c,c=-d*c-g*e-h*f;b[0]=k*a+c*-d+l*-h-m*-g;b[1]=l*a+c*-g+m*-d-k*-h;b[2]=m*a+c*-h+k*-g-l*-d; +return b};m.scale=function(a,d,b){if(!b||a===b)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a;b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[3]=a[3]*d;return b};m.toMat3=function(a,d){d||(d=x.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b*k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=m-f;d[4]=1-(l+e);d[5]=c+g;d[6]=b+h;d[7]=c-g;d[8]=1-(l+p);return d};m.toMat4=function(a,d){d||(d=t.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b* +k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=0;d[4]=m-f;d[5]=1-(l+e);d[6]=c+g;d[7]=0;d[8]=b+h;d[9]=c-g;d[10]=1-(l+p);d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d};m.slerp=function(a,d,b,c){c||(c=a);var e=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3],f,g;if(1<=Math.abs(e))return c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]),c;f=Math.acos(e);g=Math.sqrt(1-e*e);if(0.0010>Math.abs(g))return c[0]=0.5*a[0]+0.5*d[0],c[1]=0.5*a[1]+0.5*d[1],c[2]=0.5*a[2]+0.5*d[2],c[3]=0.5*a[3]+ +0.5*d[3],c;e=Math.sin((1-b)*f)/g;b=Math.sin(b*f)/g;c[0]=a[0]*e+d[0]*b;c[1]=a[1]*e+d[1]*b;c[2]=a[2]*e+d[2]*b;c[3]=a[3]*e+d[3]*b;return c};m.fromRotationMatrix=function(a,d){d||(d=m.create());var b=a[0]+a[4]+a[8],c;if(0a[0]&&(b=1);a[8]>a[3*b+b]&&(b=2);var e=c[b],f=c[e];c=Math.sqrt(a[3*b+b]-a[3*e+e]-a[3*f+f]+1);d[b]=0.5*c;c= +0.5/c;d[3]=(a[3*f+e]-a[3*e+f])*c;d[e]=(a[3*e+b]+a[3*b+e])*c;d[f]=(a[3*f+b]+a[3*b+f])*c}return d};x.toQuat4=m.fromRotationMatrix;var B=x.create();m.fromAxes=function(a,d,b,c){B[0]=d[0];B[3]=d[1];B[6]=d[2];B[1]=b[0];B[4]=b[1];B[7]=b[2];B[2]=a[0];B[5]=a[1];B[8]=a[2];return m.fromRotationMatrix(B,c)};m.identity=function(a){a||(a=m.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};m.fromAngleAxis=function(a,d,b){b||(b=m.create());a*=0.5;var c=Math.sin(a);b[3]=Math.cos(a);b[0]=c*d[0];b[1]=c*d[1];b[2]=c*d[2]; +return b};m.toAngleAxis=function(a,d){d||(d=a);var b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); +b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 +Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],e=a[1],f=a[2],g=a[3],h=c*g-f*e;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-e*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, +b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];c[0]=e*b[0]+f*b[2];c[1]=e*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=e*b+f*h;c[1]=e*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var e=b[0];b=b[1];c[0]=e*a[0]+b*a[1];c[1]=e*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var e=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=e*b;c[2]=f*h;c[3]= +g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, +b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| +(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= +f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; +PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; +PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l>1);var b=m[0];return b*(1.5-0.5*a*b*b)}}else g.invsqrt=function(a){return 1/Math.sqrt(a)}; -var l=null;f();var j={create:function(a){var b=new l(3);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0;return b},createFrom:function(a,b,e){var c=new l(3);c[0]=a;c[1]=b;c[2]=e;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])},add:function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];return e},subtract:function(a, -b,e){if(!e||a===e)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];return e},multiply:function(a,b,e){if(!e||a===e)return a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a;e[0]=a[0]*b[0];e[1]=a[1]*b[1];e[2]=a[2]*b[2];return e},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;return e},normalize:function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=Math.sqrt(e* -e+c*c+d*d);if(!k)return b[0]=0,b[1]=0,b[2]=0,b;if(1===k)return b[0]=e,b[1]=c,b[2]=d,b;k=1/k;b[0]=e*k;b[1]=c*k;b[2]=d*k;return b},cross:function(a,b,e){e||(e=a);var c=a[0],d=a[1];a=a[2];var k=b[0],h=b[1];b=b[2];e[0]=d*b-a*h;e[1]=a*k-c*b;e[2]=c*h-d*k;return e},length:function(a){var b=a[0],e=a[1];a=a[2];return Math.sqrt(b*b+e*e+a*a)},squaredLength:function(a){var b=a[0],e=a[1];a=a[2];return b*b+e*e+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,b,e){e||(e=a);var c= -a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];b=Math.sqrt(c*c+d*d+a*a);if(!b)return e[0]=0,e[1]=0,e[2]=0,e;b=1/b;e[0]=c*b;e[1]=d*b;e[2]=a*b;return e},lerp:function(a,b,e,c){c||(c=a);c[0]=a[0]+e*(b[0]-a[0]);c[1]=a[1]+e*(b[1]-a[1]);c[2]=a[2]+e*(b[2]-a[2]);return c},dist:function(a,b){var e=b[0]-a[0],c=b[1]-a[1],d=b[2]-a[2];return Math.sqrt(e*e+c*c+d*d)}},x=null,n=new l(4);j.unproject=function(a,b,e,c,d){d||(d=a);x||(x=y.create());var k=x;n[0]=2*(a[0]-c[0])/c[2]-1;n[1]=2*(a[1]-c[1])/c[3]-1;n[2]=2*a[2]-1;n[3]=1; -y.multiply(e,b,k);if(!y.inverse(k))return null;y.multiplyVec4(k,n);if(0===n[3])return null;d[0]=n[0]/n[3];d[1]=n[1]/n[3];d[2]=n[2]/n[3];return d};var z=j.createFrom(1,0,0),A=j.createFrom(0,1,0),H=j.createFrom(0,0,1),C=j.create();j.rotationTo=function(a,b,e){e||(e=s.create());var c=j.dot(a,b);if(1<=c)s.set(O,e);else if(-0.999999>c)j.cross(z,a,C),1E-6>j.length(C)&&j.cross(A,a,C),1E-6>j.length(C)&&j.cross(H,a,C),j.normalize(C),s.fromAngleAxis(Math.PI,C,e);else{var c=Math.sqrt(2*(1+c)),d=1/c;j.cross(a, -b,C);e[0]=C[0]*d;e[1]=C[1]*d;e[2]=C[2]*d;e[3]=0.5*c;s.normalize(e)}1e[3]&&(e[3]=-1);return e};j.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var F={create:function(a){var b=new l(9);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0;return b},createFrom:function(a,b,e,c,d,k,h,E,K){var q=new l(9);q[0]=a;q[1]=b;q[2]=e;q[3]=c;q[4]=d;q[5]=k;q[6]=h;q[7]=E;q[8]=K;return q},determinant:function(a){var b= -a[3],e=a[4],c=a[5],d=a[6],k=a[7],h=a[8];return a[0]*(h*e-c*k)+a[1]*(-h*b+c*d)+a[2]*(k*b-e*d)},inverse:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],E=a[5],K=a[6],q=a[7],f=a[8],g=f*h-E*q,j=-f*k+E*K,J=q*k-h*K,r=e*g+c*j+d*J;if(!r)return null;r=1/r;b||(b=F.create());b[0]=g*r;b[1]=(-f*c+d*q)*r;b[2]=(E*c-d*h)*r;b[3]=j*r;b[4]=(f*e-d*K)*r;b[5]=(-E*e+d*k)*r;b[6]=J*r;b[7]=(-q*e+c*K)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],E=a[4],f=a[5],q=a[6],g= -a[7];a=a[8];var u=b[0],j=b[1],J=b[2],r=b[3],l=b[4],t=b[5],m=b[6],p=b[7];b=b[8];e[0]=u*c+j*h+J*q;e[1]=u*d+j*E+J*g;e[2]=u*k+j*f+J*a;e[3]=r*c+l*h+t*q;e[4]=r*d+l*E+t*g;e[5]=r*k+l*f+t*a;e[6]=m*c+p*h+b*q;e[7]=m*d+p*E+b*g;e[8]=m*k+p*f+b*a;return e},multiplyVec2:function(a,b,e){e||(e=b);var c=b[0];b=b[1];e[0]=c*a[0]+b*a[3]+a[6];e[1]=c*a[1]+b*a[4]+a[7];return e},multiplyVec3:function(a,b,e){e||(e=b);var c=b[0],d=b[1];b=b[2];e[0]=c*a[0]+d*a[3]+b*a[6];e[1]=c*a[1]+d*a[4]+b*a[7];e[2]=c*a[2]+d*a[5]+b*a[8];return e}, -set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])},identity:function(a){a||(a=F.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, -b){if(!b||a===b){var e=a[1],c=a[2],d=a[5];a[1]=a[3];a[2]=a[6];a[3]=e;a[5]=a[7];a[6]=c;a[7]=d;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]=a[8];return b},toMat4:function(a,b){b||(b=y.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ -a[8]+"]"}},y={create:function(a){var b=new l(16);a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]);return b},createFrom:function(a,b,e,c,d,k,h,E,f,q,g,u,j,J,r,m){var t=new l(16);t[0]=a;t[1]=b;t[2]=e;t[3]=c;t[4]=d;t[5]=k;t[6]=h;t[7]=E;t[8]=f;t[9]=q;t[10]=g;t[11]=u;t[12]=j;t[13]=J;t[14]=r;t[15]=m;return t},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4]; -b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])&&1E-6>Math.abs(a[9]-b[9])&&1E-6>Math.abs(a[10]-b[10])&&1E-6>Math.abs(a[11]-b[11])&&1E-6>Math.abs(a[12]- -b[12])&&1E-6>Math.abs(a[13]-b[13])&&1E-6>Math.abs(a[14]-b[14])&&1E-6>Math.abs(a[15]-b[15])},identity:function(a){a||(a=y.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){var e=a[1],c=a[2],d=a[3],k=a[6],h=a[7],E=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=e;a[6]=a[9];a[7]=a[13];a[8]=c;a[9]=k;a[11]=a[14];a[12]=d;a[13]=h;a[14]=E;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12]; -b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b=a[0],e=a[1],c=a[2],d=a[3],k=a[4],h=a[5],E=a[6],f=a[7],g=a[8],I=a[9],u=a[10],j=a[11],l=a[12],r=a[13],m=a[14];a=a[15];return l*I*E*d-g*r*E*d-l*h*u*d+k*r*u*d+g*h*m*d-k*I*m*d-l*I*c*f+g*r*c*f+l*e*u*f-b*r*u*f-g*e*m*f+b*I*m*f+l*h*c*j-k*r*c*j-l*e*E*j+b*r*E*j+k*e*m*j-b*h*m*j-g*h*c*a+k*I*c*a+g*e*E*a-b*I*E*a-k*e*u*a+b*h*u*a},inverse:function(a, -b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],f=a[5],g=a[6],q=a[7],I=a[8],u=a[9],j=a[10],l=a[11],r=a[12],m=a[13],t=a[14],p=a[15],s=e*f-c*h,n=e*g-d*h,v=e*q-k*h,w=c*g-d*f,x=c*q-k*f,y=d*q-k*g,z=I*m-u*r,A=I*t-j*r,C=I*p-l*r,D=u*t-j*m,F=u*p-l*m,H=j*p-l*t,G=s*H-n*F+v*D+w*C-x*A+y*z;if(!G)return null;G=1/G;b[0]=(f*H-g*F+q*D)*G;b[1]=(-c*H+d*F-k*D)*G;b[2]=(m*y-t*x+p*w)*G;b[3]=(-u*y+j*x-l*w)*G;b[4]=(-h*H+g*C-q*A)*G;b[5]=(e*H-d*C+k*A)*G;b[6]=(-r*y+t*v-p*n)*G;b[7]=(I*y-j*v+l*n)*G;b[8]=(h*F-f*C+q*z)*G;b[9]= -(-e*F+c*C-k*z)*G;b[10]=(r*x-m*v+p*s)*G;b[11]=(-I*x+u*v-l*s)*G;b[12]=(-h*D+f*A-g*z)*G;b[13]=(e*D-c*A+d*z)*G;b[14]=(-r*w+m*n-t*s)*G;b[15]=(I*w-u*n+j*s)*G;return b},toRotationMat:function(a,b){b||(b=y.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=F.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10]; -return b},toInverseMat3:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[4],h=a[5],f=a[6],g=a[8],q=a[9],j=a[10],u=j*h-f*q,l=-j*k+f*g,m=q*k-h*g,r=e*u+c*l+d*m;if(!r)return null;r=1/r;b||(b=F.create());b[0]=u*r;b[1]=(-j*c+d*q)*r;b[2]=(f*c-d*h)*r;b[3]=l*r;b[4]=(j*e-d*g)*r;b[5]=(-f*e+d*k)*r;b[6]=m*r;b[7]=(-q*e+c*g)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],f=a[4],g=a[5],q=a[6],j=a[7],u=a[8],l=a[9],m=a[10],r=a[11],p=a[12],t=a[13],s=a[14];a=a[15];var n=b[0], -B=b[1],v=b[2],w=b[3];e[0]=n*c+B*f+v*u+w*p;e[1]=n*d+B*g+v*l+w*t;e[2]=n*k+B*q+v*m+w*s;e[3]=n*h+B*j+v*r+w*a;n=b[4];B=b[5];v=b[6];w=b[7];e[4]=n*c+B*f+v*u+w*p;e[5]=n*d+B*g+v*l+w*t;e[6]=n*k+B*q+v*m+w*s;e[7]=n*h+B*j+v*r+w*a;n=b[8];B=b[9];v=b[10];w=b[11];e[8]=n*c+B*f+v*u+w*p;e[9]=n*d+B*g+v*l+w*t;e[10]=n*k+B*q+v*m+w*s;e[11]=n*h+B*j+v*r+w*a;n=b[12];B=b[13];v=b[14];w=b[15];e[12]=n*c+B*f+v*u+w*p;e[13]=n*d+B*g+v*l+w*t;e[14]=n*k+B*q+v*m+w*s;e[15]=n*h+B*j+v*r+w*a;return e},multiplyVec3:function(a,b,e){e||(e=b); -var c=b[0],d=b[1];b=b[2];e[0]=a[0]*c+a[4]*d+a[8]*b+a[12];e[1]=a[1]*c+a[5]*d+a[9]*b+a[13];e[2]=a[2]*c+a[6]*d+a[10]*b+a[14];return e},multiplyVec4:function(a,b,e){e||(e=b);var c=b[0],d=b[1],k=b[2];b=b[3];e[0]=a[0]*c+a[4]*d+a[8]*k+a[12]*b;e[1]=a[1]*c+a[5]*d+a[9]*k+a[13]*b;e[2]=a[2]*c+a[6]*d+a[10]*k+a[14]*b;e[3]=a[3]*c+a[7]*d+a[11]*k+a[15]*b;return e},translate:function(a,b,e){var c=b[0],d=b[1];b=b[2];var k,h,f,g,q,j,u,l,m,n,p,s;if(!e||a===e)return a[12]=a[0]*c+a[4]*d+a[8]*b+a[12],a[13]=a[1]*c+a[5]*d+ -a[9]*b+a[13],a[14]=a[2]*c+a[6]*d+a[10]*b+a[14],a[15]=a[3]*c+a[7]*d+a[11]*b+a[15],a;k=a[0];h=a[1];f=a[2];g=a[3];q=a[4];j=a[5];u=a[6];l=a[7];m=a[8];n=a[9];p=a[10];s=a[11];e[0]=k;e[1]=h;e[2]=f;e[3]=g;e[4]=q;e[5]=j;e[6]=u;e[7]=l;e[8]=m;e[9]=n;e[10]=p;e[11]=s;e[12]=k*c+q*d+m*b+a[12];e[13]=h*c+j*d+n*b+a[13];e[14]=f*c+u*d+p*b+a[14];e[15]=g*c+l*d+s*b+a[15];return e},scale:function(a,b,e){var c=b[0],d=b[1];b=b[2];if(!e||a===e)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=d,a[5]*=d,a[6]*=d,a[7]*=d,a[8]*=b,a[9]*= -b,a[10]*=b,a[11]*=b,a;e[0]=a[0]*c;e[1]=a[1]*c;e[2]=a[2]*c;e[3]=a[3]*c;e[4]=a[4]*d;e[5]=a[5]*d;e[6]=a[6]*d;e[7]=a[7]*d;e[8]=a[8]*b;e[9]=a[9]*b;e[10]=a[10]*b;e[11]=a[11]*b;e[12]=a[12];e[13]=a[13];e[14]=a[14];e[15]=a[15];return e},rotate:function(a,b,e,c){var d=e[0],k=e[1];e=e[2];var h=Math.sqrt(d*d+k*k+e*e),f,g,q,j,l,m,n,r,p,s,x,y,B,v,w,z,A,C,D,F;if(!h)return null;1!==h&&(h=1/h,d*=h,k*=h,e*=h);f=Math.sin(b);g=Math.cos(b);q=1-g;b=a[0];h=a[1];j=a[2];l=a[3];m=a[4];n=a[5];r=a[6];p=a[7];s=a[8];x=a[9];y= -a[10];B=a[11];v=d*d*q+g;w=k*d*q+e*f;z=e*d*q-k*f;A=d*k*q-e*f;C=k*k*q+g;D=e*k*q+d*f;F=d*e*q+k*f;d=k*e*q-d*f;k=e*e*q+g;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=b*v+m*w+s*z;c[1]=h*v+n*w+x*z;c[2]=j*v+r*w+y*z;c[3]=l*v+p*w+B*z;c[4]=b*A+m*C+s*D;c[5]=h*A+n*C+x*D;c[6]=j*A+r*C+y*D;c[7]=l*A+p*C+B*D;c[8]=b*F+m*d+s*k;c[9]=h*F+n*d+x*k;c[10]=j*F+r*d+y*k;c[11]=l*F+p*d+B*k;return c},rotateX:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[4],k=a[5],h=a[6],f=a[7],g=a[8],q=a[9],j=a[10], -l=a[11];e?a!==e&&(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[4]=d*b+g*c;e[5]=k*b+q*c;e[6]=h*b+j*c;e[7]=f*b+l*c;e[8]=d*-c+g*b;e[9]=k*-c+q*b;e[10]=h*-c+j*b;e[11]=f*-c+l*b;return e},rotateY:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[8],j=a[9],l=a[10],m=a[11];e?a!==e&&(e[4]=a[4],e[5]=a[5],e[6]=a[6],e[7]=a[7],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*-c;e[1]=k*b+j*-c;e[2]=h*b+l*-c;e[3]=f* -b+m*-c;e[8]=d*c+g*b;e[9]=k*c+j*b;e[10]=h*c+l*b;e[11]=f*c+m*b;return e},rotateZ:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[4],j=a[5],l=a[6],m=a[7];e?a!==e&&(e[8]=a[8],e[9]=a[9],e[10]=a[10],e[11]=a[11],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*c;e[1]=k*b+j*c;e[2]=h*b+l*c;e[3]=f*b+m*c;e[4]=d*-c+g*b;e[5]=k*-c+j*b;e[6]=h*-c+l*b;e[7]=f*-c+m*b;return e},frustum:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2*d/f;h[1]=0; -h[2]=0;h[3]=0;h[4]=0;h[5]=2*d/g;h[6]=0;h[7]=0;h[8]=(b+a)/f;h[9]=(c+e)/g;h[10]=-(k+d)/j;h[11]=-1;h[12]=0;h[13]=0;h[14]=-(2*k*d)/j;h[15]=0;return h},perspective:function(a,b,e,c,d){a=e*Math.tan(a*Math.PI/360);b*=a;return y.frustum(-b,b,-a,a,e,c,d)},ortho:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2/f;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/g;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/j;h[11]=0;h[12]=-(a+b)/f;h[13]=-(c+e)/g;h[14]=-(k+d)/j;h[15]=1;return h},lookAt:function(a,b,e,c){c|| -(c=y.create());var d,k,h,f,g,j,l,m,n=a[0],p=a[1];a=a[2];h=e[0];f=e[1];k=e[2];l=b[0];e=b[1];d=b[2];if(n===l&&p===e&&a===d)return y.identity(c);b=n-l;e=p-e;l=a-d;m=1/Math.sqrt(b*b+e*e+l*l);b*=m;e*=m;l*=m;d=f*l-k*e;k=k*b-h*l;h=h*e-f*b;(m=Math.sqrt(d*d+k*k+h*h))?(m=1/m,d*=m,k*=m,h*=m):h=k=d=0;f=e*h-l*k;g=l*d-b*h;j=b*k-e*d;(m=Math.sqrt(f*f+g*g+j*j))?(m=1/m,f*=m,g*=m,j*=m):j=g=f=0;c[0]=d;c[1]=f;c[2]=b;c[3]=0;c[4]=k;c[5]=g;c[6]=e;c[7]=0;c[8]=h;c[9]=j;c[10]=l;c[11]=0;c[12]=-(d*n+k*p+h*a);c[13]=-(f*n+g*p+ -j*a);c[14]=-(b*n+e*p+l*a);c[15]=1;return c},fromRotationTranslation:function(a,b,e){e||(e=y.create());var c=a[0],d=a[1],k=a[2],h=a[3],f=c+c,g=d+d,j=k+k;a=c*f;var l=c*g,c=c*j,m=d*g,d=d*j,k=k*j,f=h*f,g=h*g,h=h*j;e[0]=1-(m+k);e[1]=l+h;e[2]=c-g;e[3]=0;e[4]=l-h;e[5]=1-(a+k);e[6]=d+f;e[7]=0;e[8]=c+g;e[9]=d-f;e[10]=1-(a+m);e[11]=0;e[12]=b[0];e[13]=b[1];e[14]=b[2];e[15]=1;return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ -a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},s={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,e,c){var d=new l(4);d[0]=a;d[1]=b;d[2]=e;d[3]=c;return d},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=s.create()); -a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},O=s.identity();s.calculateW=function(a,b){var e=a[0],c=a[1],d=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d)),a;b[0]=e;b[1]=c;b[2]=d;b[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d));return b};s.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};s.inverse=function(a,b){var e=a[0],c=a[1],d=a[2],f=a[3],e=(e=e*e+c*c+d*d+f*f)?1/e:0;if(!b||a===b)return a[0]*=-e,a[1]*=-e,a[2]*=-e,a[3]*=e,a;b[0]=-a[0]*e;b[1]=-a[1]*e;b[2]=-a[2]*e;b[3]=a[3]*e; -return b};s.conjugate=function(a,b){if(!b||a===b)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};s.length=function(a){var b=a[0],e=a[1],c=a[2];a=a[3];return Math.sqrt(b*b+e*e+c*c+a*a)};s.normalize=function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],f=a[3],h=Math.sqrt(e*e+c*c+d*d+f*f);if(0===h)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;h=1/h;b[0]=e*h;b[1]=c*h;b[2]=d*h;b[3]=f*h;return b};s.add=function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+= -b[3],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];e[3]=a[3]+b[3];return e};s.multiply=function(a,b,e){e||(e=a);var c=a[0],d=a[1],f=a[2];a=a[3];var h=b[0],g=b[1],j=b[2];b=b[3];e[0]=c*b+a*h+d*j-f*g;e[1]=d*b+a*g+f*h-c*j;e[2]=f*b+a*j+c*g-d*h;e[3]=a*b-c*h-d*g-f*j;return e};s.multiplyVec3=function(a,b,e){e||(e=b);var c=b[0],d=b[1],f=b[2];b=a[0];var h=a[1],g=a[2];a=a[3];var j=a*c+h*f-g*d,l=a*d+g*c-b*f,m=a*f+b*d-h*c,c=-b*c-h*d-g*f;e[0]=j*a+c*-b+l*-g-m*-h;e[1]=l*a+c*-h+m*-b-j*-g;e[2]=m*a+c*-g+j*-h-l*-b; -return e};s.scale=function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a[3]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;e[3]=a[3]*b;return e};s.toMat3=function(a,b){b||(b=F.create());var e=a[0],c=a[1],d=a[2],f=a[3],h=e+e,g=c+c,j=d+d,l=e*h,m=e*g,e=e*j,n=c*g,c=c*j,d=d*j,h=f*h,g=f*g,f=f*j;b[0]=1-(n+d);b[1]=m+f;b[2]=e-g;b[3]=m-f;b[4]=1-(l+d);b[5]=c+h;b[6]=e+g;b[7]=c-h;b[8]=1-(l+n);return b};s.toMat4=function(a,b){b||(b=y.create());var e=a[0],c=a[1],d=a[2],f=a[3],g=e+e,j=c+c,l=d+d,m=e*g,n=e*j,e=e* -l,p=c*j,c=c*l,d=d*l,g=f*g,j=f*j,f=f*l;b[0]=1-(p+d);b[1]=n+f;b[2]=e-j;b[3]=0;b[4]=n-f;b[5]=1-(m+d);b[6]=c+g;b[7]=0;b[8]=e+j;b[9]=c-g;b[10]=1-(m+p);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};s.slerp=function(a,b,c,d){d||(d=a);var f=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],g,h;if(1<=Math.abs(f))return d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d;g=Math.acos(f);h=Math.sqrt(1-f*f);if(0.001>Math.abs(h))return d[0]=0.5*a[0]+0.5*b[0],d[1]=0.5*a[1]+0.5*b[1],d[2]=0.5*a[2]+0.5*b[2],d[3]=0.5*a[3]+ -0.5*b[3],d;f=Math.sin((1-c)*g)/h;c=Math.sin(c*g)/h;d[0]=a[0]*f+b[0]*c;d[1]=a[1]*f+b[1]*c;d[2]=a[2]*f+b[2]*c;d[3]=a[3]*f+b[3]*c;return d};s.fromRotationMatrix=function(a,b){b||(b=s.create());var c=a[0]+a[4]+a[8],d;if(0a[0]&&(c=1);a[8]>a[3*c+c]&&(c=2);var f=d[c],g=d[f];d=Math.sqrt(a[3*c+c]-a[3*f+f]-a[3*g+g]+1);b[c]=0.5*d;d= -0.5/d;b[3]=(a[3*g+f]-a[3*f+g])*d;b[f]=(a[3*f+c]+a[3*c+f])*d;b[g]=(a[3*g+c]+a[3*c+g])*d}return b};F.toQuat4=s.fromRotationMatrix;var D=F.create();s.fromAxes=function(a,b,c,d){D[0]=b[0];D[3]=b[1];D[6]=b[2];D[1]=c[0];D[4]=c[1];D[7]=c[2];D[2]=a[0];D[5]=a[1];D[8]=a[2];return s.fromRotationMatrix(D,d)};s.identity=function(a){a||(a=s.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};s.fromAngleAxis=function(a,b,c){c||(c=s.create());a*=0.5;var d=Math.sin(a);c[3]=Math.cos(a);c[0]=d*b[0];c[1]=d*b[1];c[2]=d*b[2]; -return c};s.toAngleAxis=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); -b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 -Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],f=a[2],g=a[3],h=c*g-f*d;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-d*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, -b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];c[0]=d*b[0]+f*b[2];c[1]=d*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=d*b+f*h;c[1]=d*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var d=b[0];b=b[1];c[0]=d*a[0]+b*a[1];c[1]=d*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var d=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=d*b;c[2]=f*h;c[3]= -g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,d){var f=new l(4);f[0]=a;f[1]=b;f[2]=c;f[3]=d;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, -b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| -(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)},squaredLength:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};c&&(c.glMatrixArrayType=l,c.MatrixArray=l,c.setMatrixArrayType=d,c.determineMatrixArrayType= -f,c.glMath=g,c.vec2=M,c.vec3=j,c.vec4=N,c.mat2=L,c.mat3=F,c.mat4=y,c.quat4=s);return{glMatrixArrayType:l,MatrixArray:l,setMatrixArrayType:d,determineMatrixArrayType:f,glMath:g,vec2:M,vec3:j,vec4:N,mat2:L,mat3:F,mat4:y,quat4:s}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * vColor;","}"]; -PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"]; -PIXI.CompileVertexShader=function(c,d){for(var f="",g=0;g>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/examples/bunny benchmark/index.html b/examples/bunny benchmark/index.html index 7c5521b..95972c4 100644 --- a/examples/bunny benchmark/index.html +++ b/examples/bunny benchmark/index.html @@ -9,9 +9,10 @@ +
    Click to add more bunnys! Let me know how many you get on screen here @doormat23
    - + diff --git a/examples/bunny benchmark/js/bunnyBenchMark.js b/examples/bunny benchmark/js/bunnyBenchMark.js index a3154eb..c3c8ec5 100644 --- a/examples/bunny benchmark/js/bunnyBenchMark.js +++ b/examples/bunny benchmark/js/bunnyBenchMark.js @@ -22,18 +22,13 @@ var count = 0; var container; +var detail; + function onReady() { - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() + detail = document.getElementById("pixi"); - if(webgl) - { - renderer = new PIXI.WebGLRenderer(); - } - else - { - renderer = new PIXI.CanvasRenderer(480, 320); - } + renderer = PIXI.autoDetectRenderer(); stage = new PIXI.Stage; @@ -46,7 +41,7 @@ stats.domElement.style.top = "0px"; requestAnimFrame(update); - wabbitTexture = new PIXI.Texture("wabbit.png") + wabbitTexture = new PIXI.Texture.fromImage("wabbit.png") counter = document.createElement("div"); counter.className = "counter"; @@ -55,7 +50,6 @@ count = startBunnyCount; counter.innerHTML = count + " BUNNIES"; - container = new PIXI.DisplayObjectContainer(); stage.addChild(container); @@ -114,7 +108,9 @@ minX = 0; maxY = height; minY = 0; - + + detail.style.left = width - 204 + "px"; + detail.style.top = height - 100 + "px"; renderer.resize(width, height); } @@ -126,17 +122,17 @@ { // add 10 at a time :) - for (var i = 0; i < 2; i++) + for (var i = 0; i < 10; i++) { - var bunny = new PIXI.Sprite(wabbitTexture, {x:0, y:0, width:26, height:37}); + var bunny = new PIXI.Sprite(wabbitTexture); bunny.speedX = Math.random() * 10; bunny.speedY = (Math.random() * 10) - 5; bunny.anchor.x = 0.5; bunny.anchor.y = 1; - bunny.alpha = 0.3 + Math.random() * 0.7; + //bunny.alpha = 0.3 + Math.random() * 0.7; bunnys.push(bunny); - bunny.rotation = Math.random() - 0.5; + //bunny.rotation = Math.random() - 0.5; container.addChild(bunny); count++; diff --git a/examples/bunny benchmark/js/pixi.js b/examples/bunny benchmark/js/pixi.js new file mode 100644 index 0000000..65add09 --- /dev/null +++ b/examples/bunny benchmark/js/pixi.js @@ -0,0 +1,110 @@ +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, +d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* +j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= +a[0]-d[0],c=a[1]-d[1];a=a[2]-d[2];d=Math.sqrt(b*b+c*c+a*a);if(!d)return j[0]=0,j[1]=0,j[2]=0,j;d=1/d;j[0]=b*d;j[1]=c*d;j[2]=a*d;return j},lerp:function(a,d,j,b){b||(b=a);b[0]=a[0]+j*(d[0]-a[0]);b[1]=a[1]+j*(d[1]-a[1]);b[2]=a[2]+j*(d[2]-a[2]);return b},dist:function(a,d){var j=d[0]-a[0],b=d[1]-a[1],c=d[2]-a[2];return Math.sqrt(j*j+b*b+c*c)}},p=null,q=new k(4);l.unproject=function(a,d,j,b,c){c||(c=a);p||(p=t.create());var e=p;q[0]=2*(a[0]-b[0])/b[2]-1;q[1]=2*(a[1]-b[1])/b[3]-1;q[2]=2*a[2]-1;q[3]=1; +t.multiply(j,d,e);if(!t.inverse(e))return null;t.multiplyVec4(e,q);if(0===q[3])return null;c[0]=q[0]/q[3];c[1]=q[1]/q[3];c[2]=q[2]/q[3];return c};var C=l.createFrom(1,0,0),F=l.createFrom(0,1,0),u=l.createFrom(0,0,1),w=l.create();l.rotationTo=function(a,d,j){j||(j=m.create());var b=l.dot(a,d);if(1<=b)m.set(H,j);else if(-0.999999>b)l.cross(C,a,w),1E-6>l.length(w)&&l.cross(F,a,w),1E-6>l.length(w)&&l.cross(u,a,w),l.normalize(w),m.fromAngleAxis(Math.PI,w,j);else{var b=Math.sqrt(2*(1+b)),c=1/b;l.cross(a, +d,w);j[0]=w[0]*c;j[1]=w[1]*c;j[2]=w[2]*c;j[3]=0.5*b;m.normalize(j)}1j[3]&&(j[3]=-1);return j};l.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var x={create:function(a){var d=new k(9);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8]):d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=0;return d},createFrom:function(a,d,j,b,c,e,n,f,E){var s=new k(9);s[0]=a;s[1]=d;s[2]=j;s[3]=b;s[4]=c;s[5]=e;s[6]=n;s[7]=f;s[8]=E;return s},determinant:function(a){var d= +a[3],j=a[4],b=a[5],c=a[6],e=a[7],n=a[8];return a[0]*(n*j-b*e)+a[1]*(-n*d+b*c)+a[2]*(e*d-j*c)},inverse:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[3],n=a[4],f=a[5],E=a[6],s=a[7],I=a[8],g=I*n-f*s,h=-I*e+f*E,k=s*e-n*E,r=j*g+b*h+c*k;if(!r)return null;r=1/r;d||(d=x.create());d[0]=g*r;d[1]=(-I*b+c*s)*r;d[2]=(f*b-c*n)*r;d[3]=h*r;d[4]=(I*j-c*E)*r;d[5]=(-f*j+c*e)*r;d[6]=k*r;d[7]=(-s*j+b*E)*r;d[8]=(n*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],D=a[4],E=a[5],s=a[6],I= +a[7];a=a[8];var g=d[0],h=d[1],k=d[2],r=d[3],m=d[4],l=d[5],q=d[6],v=d[7];d=d[8];j[0]=g*b+h*f+k*s;j[1]=g*c+h*D+k*I;j[2]=g*e+h*E+k*a;j[3]=r*b+m*f+l*s;j[4]=r*c+m*D+l*I;j[5]=r*e+m*E+l*a;j[6]=q*b+v*f+d*s;j[7]=q*c+v*D+d*I;j[8]=q*e+v*E+d*a;return j},multiplyVec2:function(a,d,j){j||(j=d);var b=d[0];d=d[1];j[0]=b*a[0]+d*a[3]+a[6];j[1]=b*a[1]+d*a[4]+a[7];return j},multiplyVec3:function(a,d,j){j||(j=d);var b=d[0],c=d[1];d=d[2];j[0]=b*a[0]+c*a[3]+d*a[6];j[1]=b*a[1]+c*a[4]+d*a[7];j[2]=b*a[2]+c*a[5]+d*a[8];return j}, +set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])},identity:function(a){a||(a=x.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, +d){if(!d||a===d){var j=a[1],b=a[2],c=a[5];a[1]=a[3];a[2]=a[6];a[3]=j;a[5]=a[7];a[6]=b;a[7]=c;return a}d[0]=a[0];d[1]=a[3];d[2]=a[6];d[3]=a[1];d[4]=a[4];d[5]=a[7];d[6]=a[2];d[7]=a[5];d[8]=a[8];return d},toMat4:function(a,d){d||(d=t.create());d[15]=1;d[14]=0;d[13]=0;d[12]=0;d[11]=0;d[10]=a[8];d[9]=a[7];d[8]=a[6];d[7]=0;d[6]=a[5];d[5]=a[4];d[4]=a[3];d[3]=0;d[2]=a[2];d[1]=a[1];d[0]=a[0];return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ +a[8]+"]"}},t={create:function(a){var d=new k(16);a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8],d[9]=a[9],d[10]=a[10],d[11]=a[11],d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d},createFrom:function(a,d,j,b,c,e,f,D,E,s,g,h,m,l,r,q){var A=new k(16);A[0]=a;A[1]=d;A[2]=j;A[3]=b;A[4]=c;A[5]=e;A[6]=f;A[7]=D;A[8]=E;A[9]=s;A[10]=g;A[11]=h;A[12]=m;A[13]=l;A[14]=r;A[15]=q;return A},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4]; +d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=a[12];d[13]=a[13];d[14]=a[14];d[15]=a[15];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])&&1E-6>Math.abs(a[9]-d[9])&&1E-6>Math.abs(a[10]-d[10])&&1E-6>Math.abs(a[11]-d[11])&&1E-6>Math.abs(a[12]- +d[12])&&1E-6>Math.abs(a[13]-d[13])&&1E-6>Math.abs(a[14]-d[14])&&1E-6>Math.abs(a[15]-d[15])},identity:function(a){a||(a=t.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,d){if(!d||a===d){var j=a[1],b=a[2],c=a[3],e=a[6],f=a[7],D=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=j;a[6]=a[9];a[7]=a[13];a[8]=b;a[9]=e;a[11]=a[14];a[12]=c;a[13]=f;a[14]=D;return a}d[0]=a[0];d[1]=a[4];d[2]=a[8];d[3]=a[12]; +d[4]=a[1];d[5]=a[5];d[6]=a[9];d[7]=a[13];d[8]=a[2];d[9]=a[6];d[10]=a[10];d[11]=a[14];d[12]=a[3];d[13]=a[7];d[14]=a[11];d[15]=a[15];return d},determinant:function(a){var d=a[0],j=a[1],b=a[2],c=a[3],e=a[4],f=a[5],D=a[6],E=a[7],s=a[8],g=a[9],h=a[10],k=a[11],m=a[12],r=a[13],l=a[14];a=a[15];return m*g*D*c-s*r*D*c-m*f*h*c+e*r*h*c+s*f*l*c-e*g*l*c-m*g*b*E+s*r*b*E+m*j*h*E-d*r*h*E-s*j*l*E+d*g*l*E+m*f*b*k-e*r*b*k-m*j*D*k+d*r*D*k+e*j*l*k-d*f*l*k-s*f*b*a+e*g*b*a+s*j*D*a-d*g*D*a-e*j*h*a+d*f*h*a},inverse:function(a, +d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=a[3],f=a[4],D=a[5],E=a[6],s=a[7],g=a[8],h=a[9],k=a[10],m=a[11],r=a[12],l=a[13],A=a[14],q=a[15],v=j*D-b*f,J=j*E-c*f,y=j*s-e*f,z=b*E-c*D,t=b*s-e*D,u=c*s-e*E,p=g*l-h*r,w=g*A-k*r,x=g*q-m*r,B=h*A-k*l,C=h*q-m*l,F=k*q-m*A,G=v*F-J*C+y*B+z*x-t*w+u*p;if(!G)return null;G=1/G;d[0]=(D*F-E*C+s*B)*G;d[1]=(-b*F+c*C-e*B)*G;d[2]=(l*u-A*t+q*z)*G;d[3]=(-h*u+k*t-m*z)*G;d[4]=(-f*F+E*x-s*w)*G;d[5]=(j*F-c*x+e*w)*G;d[6]=(-r*u+A*y-q*J)*G;d[7]=(g*u-k*y+m*J)*G;d[8]=(f*C-D*x+s*p)*G;d[9]= +(-j*C+b*x-e*p)*G;d[10]=(r*t-l*y+q*v)*G;d[11]=(-g*t+h*y-m*v)*G;d[12]=(-f*B+D*w-E*p)*G;d[13]=(j*B-b*w+c*p)*G;d[14]=(-r*z+l*J-A*v)*G;d[15]=(g*z-h*J+k*v)*G;return d},toRotationMat:function(a,d){d||(d=t.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d},toMat3:function(a,d){d||(d=x.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[4];d[4]=a[5];d[5]=a[6];d[6]=a[8];d[7]=a[9];d[8]=a[10]; +return d},toInverseMat3:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[4],f=a[5],D=a[6],g=a[8],s=a[9],h=a[10],k=h*f-D*s,m=-h*e+D*g,l=s*e-f*g,r=j*k+b*m+c*l;if(!r)return null;r=1/r;d||(d=x.create());d[0]=k*r;d[1]=(-h*b+c*s)*r;d[2]=(D*b-c*f)*r;d[3]=m*r;d[4]=(h*j-c*g)*r;d[5]=(-D*j+c*e)*r;d[6]=l*r;d[7]=(-s*j+b*g)*r;d[8]=(f*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],s=a[6],k=a[7],m=a[8],l=a[9],q=a[10],r=a[11],t=a[12],A=a[13],u=a[14];a=a[15];var v=d[0], +p=d[1],y=d[2],z=d[3];j[0]=v*b+p*g+y*m+z*t;j[1]=v*c+p*h+y*l+z*A;j[2]=v*e+p*s+y*q+z*u;j[3]=v*f+p*k+y*r+z*a;v=d[4];p=d[5];y=d[6];z=d[7];j[4]=v*b+p*g+y*m+z*t;j[5]=v*c+p*h+y*l+z*A;j[6]=v*e+p*s+y*q+z*u;j[7]=v*f+p*k+y*r+z*a;v=d[8];p=d[9];y=d[10];z=d[11];j[8]=v*b+p*g+y*m+z*t;j[9]=v*c+p*h+y*l+z*A;j[10]=v*e+p*s+y*q+z*u;j[11]=v*f+p*k+y*r+z*a;v=d[12];p=d[13];y=d[14];z=d[15];j[12]=v*b+p*g+y*m+z*t;j[13]=v*c+p*h+y*l+z*A;j[14]=v*e+p*s+y*q+z*u;j[15]=v*f+p*k+y*r+z*a;return j},multiplyVec3:function(a,d,b){b||(b=d); +var c=d[0],e=d[1];d=d[2];b[0]=a[0]*c+a[4]*e+a[8]*d+a[12];b[1]=a[1]*c+a[5]*e+a[9]*d+a[13];b[2]=a[2]*c+a[6]*e+a[10]*d+a[14];return b},multiplyVec4:function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=d[3];b[0]=a[0]*c+a[4]*e+a[8]*f+a[12]*d;b[1]=a[1]*c+a[5]*e+a[9]*f+a[13]*d;b[2]=a[2]*c+a[6]*e+a[10]*f+a[14]*d;b[3]=a[3]*c+a[7]*e+a[11]*f+a[15]*d;return b},translate:function(a,d,b){var c=d[0],e=d[1];d=d[2];var f,n,g,h,s,k,m,l,p,r,q,t;if(!b||a===b)return a[12]=a[0]*c+a[4]*e+a[8]*d+a[12],a[13]=a[1]*c+a[5]*e+ +a[9]*d+a[13],a[14]=a[2]*c+a[6]*e+a[10]*d+a[14],a[15]=a[3]*c+a[7]*e+a[11]*d+a[15],a;f=a[0];n=a[1];g=a[2];h=a[3];s=a[4];k=a[5];m=a[6];l=a[7];p=a[8];r=a[9];q=a[10];t=a[11];b[0]=f;b[1]=n;b[2]=g;b[3]=h;b[4]=s;b[5]=k;b[6]=m;b[7]=l;b[8]=p;b[9]=r;b[10]=q;b[11]=t;b[12]=f*c+s*e+p*d+a[12];b[13]=n*c+k*e+r*d+a[13];b[14]=g*c+m*e+q*d+a[14];b[15]=h*c+l*e+t*d+a[15];return b},scale:function(a,d,b){var c=d[0],e=d[1];d=d[2];if(!b||a===b)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=d,a[9]*= +d,a[10]*=d,a[11]*=d,a;b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[7]=a[7]*e;b[8]=a[8]*d;b[9]=a[9]*d;b[10]=a[10]*d;b[11]=a[11]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},rotate:function(a,d,b,c){var e=b[0],f=b[1];b=b[2];var n=Math.sqrt(e*e+f*f+b*b),g,h,k,m,l,p,q,r,t,u,w,v,x,y,z,B,C,F,H,K;if(!n)return null;1!==n&&(n=1/n,e*=n,f*=n,b*=n);g=Math.sin(d);h=Math.cos(d);k=1-h;d=a[0];n=a[1];m=a[2];l=a[3];p=a[4];q=a[5];r=a[6];t=a[7];u=a[8];w=a[9];v= +a[10];x=a[11];y=e*e*k+h;z=f*e*k+b*g;B=b*e*k-f*g;C=e*f*k-b*g;F=f*f*k+h;H=b*f*k+e*g;K=e*b*k+f*g;e=f*b*k-e*g;f=b*b*k+h;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=d*y+p*z+u*B;c[1]=n*y+q*z+w*B;c[2]=m*y+r*z+v*B;c[3]=l*y+t*z+x*B;c[4]=d*C+p*F+u*H;c[5]=n*C+q*F+w*H;c[6]=m*C+r*F+v*H;c[7]=l*C+t*F+x*H;c[8]=d*K+p*e+u*f;c[9]=n*K+q*e+w*f;c[10]=m*K+r*e+v*f;c[11]=l*K+t*e+x*f;return c},rotateX:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[4],f=a[5],n=a[6],g=a[7],h=a[8],k=a[9],m=a[10], +l=a[11];b?a!==b&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[4]=e*d+h*c;b[5]=f*d+k*c;b[6]=n*d+m*c;b[7]=g*d+l*c;b[8]=e*-c+h*d;b[9]=f*-c+k*d;b[10]=n*-c+m*d;b[11]=g*-c+l*d;return b},rotateY:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[8],k=a[9],m=a[10],l=a[11];b?a!==b&&(b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*-c;b[1]=f*d+k*-c;b[2]=n*d+m*-c;b[3]=g* +d+l*-c;b[8]=e*c+h*d;b[9]=f*c+k*d;b[10]=n*c+m*d;b[11]=g*c+l*d;return b},rotateZ:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[4],k=a[5],m=a[6],l=a[7];b?a!==b&&(b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*c;b[1]=f*d+k*c;b[2]=n*d+m*c;b[3]=g*d+l*c;b[4]=e*-c+h*d;b[5]=f*-c+k*d;b[6]=n*-c+m*d;b[7]=g*-c+l*d;return b},frustum:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2*e/g;n[1]=0; +n[2]=0;n[3]=0;n[4]=0;n[5]=2*e/h;n[6]=0;n[7]=0;n[8]=(d+a)/g;n[9]=(c+b)/h;n[10]=-(f+e)/k;n[11]=-1;n[12]=0;n[13]=0;n[14]=-(2*f*e)/k;n[15]=0;return n},perspective:function(a,d,b,c,e){a=b*Math.tan(a*Math.PI/360);d*=a;return t.frustum(-d,d,-a,a,b,c,e)},ortho:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2/g;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=2/h;n[6]=0;n[7]=0;n[8]=0;n[9]=0;n[10]=-2/k;n[11]=0;n[12]=-(a+d)/g;n[13]=-(c+b)/h;n[14]=-(f+e)/k;n[15]=1;return n},lookAt:function(a,d,b,c){c|| +(c=t.create());var e,f,n,g,h,k,m,l,p=a[0],q=a[1];a=a[2];n=b[0];g=b[1];f=b[2];m=d[0];b=d[1];e=d[2];if(p===m&&q===b&&a===e)return t.identity(c);d=p-m;b=q-b;m=a-e;l=1/Math.sqrt(d*d+b*b+m*m);d*=l;b*=l;m*=l;e=g*m-f*b;f=f*d-n*m;n=n*b-g*d;(l=Math.sqrt(e*e+f*f+n*n))?(l=1/l,e*=l,f*=l,n*=l):n=f=e=0;g=b*n-m*f;h=m*e-d*n;k=d*f-b*e;(l=Math.sqrt(g*g+h*h+k*k))?(l=1/l,g*=l,h*=l,k*=l):k=h=g=0;c[0]=e;c[1]=g;c[2]=d;c[3]=0;c[4]=f;c[5]=h;c[6]=b;c[7]=0;c[8]=n;c[9]=k;c[10]=m;c[11]=0;c[12]=-(e*p+f*q+n*a);c[13]=-(g*p+h*q+ +k*a);c[14]=-(d*p+b*q+m*a);c[15]=1;return c},fromRotationTranslation:function(a,d,b){b||(b=t.create());var c=a[0],e=a[1],f=a[2],n=a[3],g=c+c,h=e+e,k=f+f;a=c*g;var l=c*h,c=c*k,m=e*h,e=e*k,f=f*k,g=n*g,h=n*h,n=n*k;b[0]=1-(m+f);b[1]=l+n;b[2]=c-h;b[3]=0;b[4]=l-n;b[5]=1-(a+f);b[6]=e+g;b[7]=0;b[8]=c+h;b[9]=e-g;b[10]=1-(a+m);b[11]=0;b[12]=d[0];b[13]=d[1];b[14]=d[2];b[15]=1;return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ +a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},m={create:function(a){var d=new k(4);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]):d[0]=d[1]=d[2]=d[3]=0;return d},createFrom:function(a,d,b,c){var e=new k(4);e[0]=a;e[1]=d;e[2]=b;e[3]=c;return e},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])},identity:function(a){a||(a=m.create()); +a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},H=m.identity();m.calculateW=function(a,d){var b=a[0],c=a[1],e=a[2];if(!d||a===d)return a[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e)),a;d[0]=b;d[1]=c;d[2]=e;d[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e));return d};m.dot=function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3]};m.inverse=function(a,d){var b=a[0],c=a[1],e=a[2],f=a[3],b=(b=b*b+c*c+e*e+f*f)?1/b:0;if(!d||a===d)return a[0]*=-b,a[1]*=-b,a[2]*=-b,a[3]*=b,a;d[0]=-a[0]*b;d[1]=-a[1]*b;d[2]=-a[2]*b;d[3]=a[3]*b; +return d};m.conjugate=function(a,d){if(!d||a===d)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=a[3];return d};m.length=function(a){var d=a[0],b=a[1],c=a[2];a=a[3];return Math.sqrt(d*d+b*b+c*c+a*a)};m.normalize=function(a,d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=Math.sqrt(b*b+c*c+e*e+f*f);if(0===g)return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d;g=1/g;d[0]=b*g;d[1]=c*g;d[2]=e*g;d[3]=f*g;return d};m.add=function(a,d,b){if(!b||a===b)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a[3]+= +d[3],a;b[0]=a[0]+d[0];b[1]=a[1]+d[1];b[2]=a[2]+d[2];b[3]=a[3]+d[3];return b};m.multiply=function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2];a=a[3];var g=d[0],h=d[1],k=d[2];d=d[3];b[0]=c*d+a*g+e*k-f*h;b[1]=e*d+a*h+f*g-c*k;b[2]=f*d+a*k+c*h-e*g;b[3]=a*d-c*g-e*h-f*k;return b};m.multiplyVec3=function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=a[0];var g=a[1],h=a[2];a=a[3];var k=a*c+g*f-h*e,l=a*e+h*c-d*f,m=a*f+d*e-g*c,c=-d*c-g*e-h*f;b[0]=k*a+c*-d+l*-h-m*-g;b[1]=l*a+c*-g+m*-d-k*-h;b[2]=m*a+c*-h+k*-g-l*-d; +return b};m.scale=function(a,d,b){if(!b||a===b)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a;b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[3]=a[3]*d;return b};m.toMat3=function(a,d){d||(d=x.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b*k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=m-f;d[4]=1-(l+e);d[5]=c+g;d[6]=b+h;d[7]=c-g;d[8]=1-(l+p);return d};m.toMat4=function(a,d){d||(d=t.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b* +k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=0;d[4]=m-f;d[5]=1-(l+e);d[6]=c+g;d[7]=0;d[8]=b+h;d[9]=c-g;d[10]=1-(l+p);d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d};m.slerp=function(a,d,b,c){c||(c=a);var e=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3],f,g;if(1<=Math.abs(e))return c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]),c;f=Math.acos(e);g=Math.sqrt(1-e*e);if(0.0010>Math.abs(g))return c[0]=0.5*a[0]+0.5*d[0],c[1]=0.5*a[1]+0.5*d[1],c[2]=0.5*a[2]+0.5*d[2],c[3]=0.5*a[3]+ +0.5*d[3],c;e=Math.sin((1-b)*f)/g;b=Math.sin(b*f)/g;c[0]=a[0]*e+d[0]*b;c[1]=a[1]*e+d[1]*b;c[2]=a[2]*e+d[2]*b;c[3]=a[3]*e+d[3]*b;return c};m.fromRotationMatrix=function(a,d){d||(d=m.create());var b=a[0]+a[4]+a[8],c;if(0a[0]&&(b=1);a[8]>a[3*b+b]&&(b=2);var e=c[b],f=c[e];c=Math.sqrt(a[3*b+b]-a[3*e+e]-a[3*f+f]+1);d[b]=0.5*c;c= +0.5/c;d[3]=(a[3*f+e]-a[3*e+f])*c;d[e]=(a[3*e+b]+a[3*b+e])*c;d[f]=(a[3*f+b]+a[3*b+f])*c}return d};x.toQuat4=m.fromRotationMatrix;var B=x.create();m.fromAxes=function(a,d,b,c){B[0]=d[0];B[3]=d[1];B[6]=d[2];B[1]=b[0];B[4]=b[1];B[7]=b[2];B[2]=a[0];B[5]=a[1];B[8]=a[2];return m.fromRotationMatrix(B,c)};m.identity=function(a){a||(a=m.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};m.fromAngleAxis=function(a,d,b){b||(b=m.create());a*=0.5;var c=Math.sin(a);b[3]=Math.cos(a);b[0]=c*d[0];b[1]=c*d[1];b[2]=c*d[2]; +return b};m.toAngleAxis=function(a,d){d||(d=a);var b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); +b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 +Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],e=a[1],f=a[2],g=a[3],h=c*g-f*e;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-e*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, +b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];c[0]=e*b[0]+f*b[2];c[1]=e*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=e*b+f*h;c[1]=e*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var e=b[0];b=b[1];c[0]=e*a[0]+b*a[1];c[1]=e*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var e=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=e*b;c[2]=f*h;c[3]= +g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, +b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| +(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= +f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; +PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; +PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l>1);var b=m[0];return b*(1.5-0.5*a*b*b)}}else g.invsqrt=function(a){return 1/Math.sqrt(a)}; -var l=null;f();var j={create:function(a){var b=new l(3);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0;return b},createFrom:function(a,b,e){var c=new l(3);c[0]=a;c[1]=b;c[2]=e;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])},add:function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];return e},subtract:function(a, -b,e){if(!e||a===e)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];return e},multiply:function(a,b,e){if(!e||a===e)return a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a;e[0]=a[0]*b[0];e[1]=a[1]*b[1];e[2]=a[2]*b[2];return e},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;return e},normalize:function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=Math.sqrt(e* -e+c*c+d*d);if(!k)return b[0]=0,b[1]=0,b[2]=0,b;if(1===k)return b[0]=e,b[1]=c,b[2]=d,b;k=1/k;b[0]=e*k;b[1]=c*k;b[2]=d*k;return b},cross:function(a,b,e){e||(e=a);var c=a[0],d=a[1];a=a[2];var k=b[0],h=b[1];b=b[2];e[0]=d*b-a*h;e[1]=a*k-c*b;e[2]=c*h-d*k;return e},length:function(a){var b=a[0],e=a[1];a=a[2];return Math.sqrt(b*b+e*e+a*a)},squaredLength:function(a){var b=a[0],e=a[1];a=a[2];return b*b+e*e+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,b,e){e||(e=a);var c= -a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];b=Math.sqrt(c*c+d*d+a*a);if(!b)return e[0]=0,e[1]=0,e[2]=0,e;b=1/b;e[0]=c*b;e[1]=d*b;e[2]=a*b;return e},lerp:function(a,b,e,c){c||(c=a);c[0]=a[0]+e*(b[0]-a[0]);c[1]=a[1]+e*(b[1]-a[1]);c[2]=a[2]+e*(b[2]-a[2]);return c},dist:function(a,b){var e=b[0]-a[0],c=b[1]-a[1],d=b[2]-a[2];return Math.sqrt(e*e+c*c+d*d)}},x=null,n=new l(4);j.unproject=function(a,b,e,c,d){d||(d=a);x||(x=y.create());var k=x;n[0]=2*(a[0]-c[0])/c[2]-1;n[1]=2*(a[1]-c[1])/c[3]-1;n[2]=2*a[2]-1;n[3]=1; -y.multiply(e,b,k);if(!y.inverse(k))return null;y.multiplyVec4(k,n);if(0===n[3])return null;d[0]=n[0]/n[3];d[1]=n[1]/n[3];d[2]=n[2]/n[3];return d};var z=j.createFrom(1,0,0),A=j.createFrom(0,1,0),H=j.createFrom(0,0,1),C=j.create();j.rotationTo=function(a,b,e){e||(e=s.create());var c=j.dot(a,b);if(1<=c)s.set(O,e);else if(-0.999999>c)j.cross(z,a,C),1E-6>j.length(C)&&j.cross(A,a,C),1E-6>j.length(C)&&j.cross(H,a,C),j.normalize(C),s.fromAngleAxis(Math.PI,C,e);else{var c=Math.sqrt(2*(1+c)),d=1/c;j.cross(a, -b,C);e[0]=C[0]*d;e[1]=C[1]*d;e[2]=C[2]*d;e[3]=0.5*c;s.normalize(e)}1e[3]&&(e[3]=-1);return e};j.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var F={create:function(a){var b=new l(9);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0;return b},createFrom:function(a,b,e,c,d,k,h,E,K){var q=new l(9);q[0]=a;q[1]=b;q[2]=e;q[3]=c;q[4]=d;q[5]=k;q[6]=h;q[7]=E;q[8]=K;return q},determinant:function(a){var b= -a[3],e=a[4],c=a[5],d=a[6],k=a[7],h=a[8];return a[0]*(h*e-c*k)+a[1]*(-h*b+c*d)+a[2]*(k*b-e*d)},inverse:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],E=a[5],K=a[6],q=a[7],f=a[8],g=f*h-E*q,j=-f*k+E*K,J=q*k-h*K,r=e*g+c*j+d*J;if(!r)return null;r=1/r;b||(b=F.create());b[0]=g*r;b[1]=(-f*c+d*q)*r;b[2]=(E*c-d*h)*r;b[3]=j*r;b[4]=(f*e-d*K)*r;b[5]=(-E*e+d*k)*r;b[6]=J*r;b[7]=(-q*e+c*K)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],E=a[4],f=a[5],q=a[6],g= -a[7];a=a[8];var u=b[0],j=b[1],J=b[2],r=b[3],l=b[4],t=b[5],m=b[6],p=b[7];b=b[8];e[0]=u*c+j*h+J*q;e[1]=u*d+j*E+J*g;e[2]=u*k+j*f+J*a;e[3]=r*c+l*h+t*q;e[4]=r*d+l*E+t*g;e[5]=r*k+l*f+t*a;e[6]=m*c+p*h+b*q;e[7]=m*d+p*E+b*g;e[8]=m*k+p*f+b*a;return e},multiplyVec2:function(a,b,e){e||(e=b);var c=b[0];b=b[1];e[0]=c*a[0]+b*a[3]+a[6];e[1]=c*a[1]+b*a[4]+a[7];return e},multiplyVec3:function(a,b,e){e||(e=b);var c=b[0],d=b[1];b=b[2];e[0]=c*a[0]+d*a[3]+b*a[6];e[1]=c*a[1]+d*a[4]+b*a[7];e[2]=c*a[2]+d*a[5]+b*a[8];return e}, -set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])},identity:function(a){a||(a=F.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, -b){if(!b||a===b){var e=a[1],c=a[2],d=a[5];a[1]=a[3];a[2]=a[6];a[3]=e;a[5]=a[7];a[6]=c;a[7]=d;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]=a[8];return b},toMat4:function(a,b){b||(b=y.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ -a[8]+"]"}},y={create:function(a){var b=new l(16);a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]);return b},createFrom:function(a,b,e,c,d,k,h,E,f,q,g,u,j,J,r,m){var t=new l(16);t[0]=a;t[1]=b;t[2]=e;t[3]=c;t[4]=d;t[5]=k;t[6]=h;t[7]=E;t[8]=f;t[9]=q;t[10]=g;t[11]=u;t[12]=j;t[13]=J;t[14]=r;t[15]=m;return t},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4]; -b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])&&1E-6>Math.abs(a[9]-b[9])&&1E-6>Math.abs(a[10]-b[10])&&1E-6>Math.abs(a[11]-b[11])&&1E-6>Math.abs(a[12]- -b[12])&&1E-6>Math.abs(a[13]-b[13])&&1E-6>Math.abs(a[14]-b[14])&&1E-6>Math.abs(a[15]-b[15])},identity:function(a){a||(a=y.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){var e=a[1],c=a[2],d=a[3],k=a[6],h=a[7],E=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=e;a[6]=a[9];a[7]=a[13];a[8]=c;a[9]=k;a[11]=a[14];a[12]=d;a[13]=h;a[14]=E;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12]; -b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b=a[0],e=a[1],c=a[2],d=a[3],k=a[4],h=a[5],E=a[6],f=a[7],g=a[8],I=a[9],u=a[10],j=a[11],l=a[12],r=a[13],m=a[14];a=a[15];return l*I*E*d-g*r*E*d-l*h*u*d+k*r*u*d+g*h*m*d-k*I*m*d-l*I*c*f+g*r*c*f+l*e*u*f-b*r*u*f-g*e*m*f+b*I*m*f+l*h*c*j-k*r*c*j-l*e*E*j+b*r*E*j+k*e*m*j-b*h*m*j-g*h*c*a+k*I*c*a+g*e*E*a-b*I*E*a-k*e*u*a+b*h*u*a},inverse:function(a, -b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],f=a[5],g=a[6],q=a[7],I=a[8],u=a[9],j=a[10],l=a[11],r=a[12],m=a[13],t=a[14],p=a[15],s=e*f-c*h,n=e*g-d*h,v=e*q-k*h,w=c*g-d*f,x=c*q-k*f,y=d*q-k*g,z=I*m-u*r,A=I*t-j*r,C=I*p-l*r,D=u*t-j*m,F=u*p-l*m,H=j*p-l*t,G=s*H-n*F+v*D+w*C-x*A+y*z;if(!G)return null;G=1/G;b[0]=(f*H-g*F+q*D)*G;b[1]=(-c*H+d*F-k*D)*G;b[2]=(m*y-t*x+p*w)*G;b[3]=(-u*y+j*x-l*w)*G;b[4]=(-h*H+g*C-q*A)*G;b[5]=(e*H-d*C+k*A)*G;b[6]=(-r*y+t*v-p*n)*G;b[7]=(I*y-j*v+l*n)*G;b[8]=(h*F-f*C+q*z)*G;b[9]= -(-e*F+c*C-k*z)*G;b[10]=(r*x-m*v+p*s)*G;b[11]=(-I*x+u*v-l*s)*G;b[12]=(-h*D+f*A-g*z)*G;b[13]=(e*D-c*A+d*z)*G;b[14]=(-r*w+m*n-t*s)*G;b[15]=(I*w-u*n+j*s)*G;return b},toRotationMat:function(a,b){b||(b=y.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=F.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10]; -return b},toInverseMat3:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[4],h=a[5],f=a[6],g=a[8],q=a[9],j=a[10],u=j*h-f*q,l=-j*k+f*g,m=q*k-h*g,r=e*u+c*l+d*m;if(!r)return null;r=1/r;b||(b=F.create());b[0]=u*r;b[1]=(-j*c+d*q)*r;b[2]=(f*c-d*h)*r;b[3]=l*r;b[4]=(j*e-d*g)*r;b[5]=(-f*e+d*k)*r;b[6]=m*r;b[7]=(-q*e+c*g)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],f=a[4],g=a[5],q=a[6],j=a[7],u=a[8],l=a[9],m=a[10],r=a[11],p=a[12],t=a[13],s=a[14];a=a[15];var n=b[0], -B=b[1],v=b[2],w=b[3];e[0]=n*c+B*f+v*u+w*p;e[1]=n*d+B*g+v*l+w*t;e[2]=n*k+B*q+v*m+w*s;e[3]=n*h+B*j+v*r+w*a;n=b[4];B=b[5];v=b[6];w=b[7];e[4]=n*c+B*f+v*u+w*p;e[5]=n*d+B*g+v*l+w*t;e[6]=n*k+B*q+v*m+w*s;e[7]=n*h+B*j+v*r+w*a;n=b[8];B=b[9];v=b[10];w=b[11];e[8]=n*c+B*f+v*u+w*p;e[9]=n*d+B*g+v*l+w*t;e[10]=n*k+B*q+v*m+w*s;e[11]=n*h+B*j+v*r+w*a;n=b[12];B=b[13];v=b[14];w=b[15];e[12]=n*c+B*f+v*u+w*p;e[13]=n*d+B*g+v*l+w*t;e[14]=n*k+B*q+v*m+w*s;e[15]=n*h+B*j+v*r+w*a;return e},multiplyVec3:function(a,b,e){e||(e=b); -var c=b[0],d=b[1];b=b[2];e[0]=a[0]*c+a[4]*d+a[8]*b+a[12];e[1]=a[1]*c+a[5]*d+a[9]*b+a[13];e[2]=a[2]*c+a[6]*d+a[10]*b+a[14];return e},multiplyVec4:function(a,b,e){e||(e=b);var c=b[0],d=b[1],k=b[2];b=b[3];e[0]=a[0]*c+a[4]*d+a[8]*k+a[12]*b;e[1]=a[1]*c+a[5]*d+a[9]*k+a[13]*b;e[2]=a[2]*c+a[6]*d+a[10]*k+a[14]*b;e[3]=a[3]*c+a[7]*d+a[11]*k+a[15]*b;return e},translate:function(a,b,e){var c=b[0],d=b[1];b=b[2];var k,h,f,g,q,j,u,l,m,n,p,s;if(!e||a===e)return a[12]=a[0]*c+a[4]*d+a[8]*b+a[12],a[13]=a[1]*c+a[5]*d+ -a[9]*b+a[13],a[14]=a[2]*c+a[6]*d+a[10]*b+a[14],a[15]=a[3]*c+a[7]*d+a[11]*b+a[15],a;k=a[0];h=a[1];f=a[2];g=a[3];q=a[4];j=a[5];u=a[6];l=a[7];m=a[8];n=a[9];p=a[10];s=a[11];e[0]=k;e[1]=h;e[2]=f;e[3]=g;e[4]=q;e[5]=j;e[6]=u;e[7]=l;e[8]=m;e[9]=n;e[10]=p;e[11]=s;e[12]=k*c+q*d+m*b+a[12];e[13]=h*c+j*d+n*b+a[13];e[14]=f*c+u*d+p*b+a[14];e[15]=g*c+l*d+s*b+a[15];return e},scale:function(a,b,e){var c=b[0],d=b[1];b=b[2];if(!e||a===e)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=d,a[5]*=d,a[6]*=d,a[7]*=d,a[8]*=b,a[9]*= -b,a[10]*=b,a[11]*=b,a;e[0]=a[0]*c;e[1]=a[1]*c;e[2]=a[2]*c;e[3]=a[3]*c;e[4]=a[4]*d;e[5]=a[5]*d;e[6]=a[6]*d;e[7]=a[7]*d;e[8]=a[8]*b;e[9]=a[9]*b;e[10]=a[10]*b;e[11]=a[11]*b;e[12]=a[12];e[13]=a[13];e[14]=a[14];e[15]=a[15];return e},rotate:function(a,b,e,c){var d=e[0],k=e[1];e=e[2];var h=Math.sqrt(d*d+k*k+e*e),f,g,q,j,l,m,n,r,p,s,x,y,B,v,w,z,A,C,D,F;if(!h)return null;1!==h&&(h=1/h,d*=h,k*=h,e*=h);f=Math.sin(b);g=Math.cos(b);q=1-g;b=a[0];h=a[1];j=a[2];l=a[3];m=a[4];n=a[5];r=a[6];p=a[7];s=a[8];x=a[9];y= -a[10];B=a[11];v=d*d*q+g;w=k*d*q+e*f;z=e*d*q-k*f;A=d*k*q-e*f;C=k*k*q+g;D=e*k*q+d*f;F=d*e*q+k*f;d=k*e*q-d*f;k=e*e*q+g;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=b*v+m*w+s*z;c[1]=h*v+n*w+x*z;c[2]=j*v+r*w+y*z;c[3]=l*v+p*w+B*z;c[4]=b*A+m*C+s*D;c[5]=h*A+n*C+x*D;c[6]=j*A+r*C+y*D;c[7]=l*A+p*C+B*D;c[8]=b*F+m*d+s*k;c[9]=h*F+n*d+x*k;c[10]=j*F+r*d+y*k;c[11]=l*F+p*d+B*k;return c},rotateX:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[4],k=a[5],h=a[6],f=a[7],g=a[8],q=a[9],j=a[10], -l=a[11];e?a!==e&&(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[4]=d*b+g*c;e[5]=k*b+q*c;e[6]=h*b+j*c;e[7]=f*b+l*c;e[8]=d*-c+g*b;e[9]=k*-c+q*b;e[10]=h*-c+j*b;e[11]=f*-c+l*b;return e},rotateY:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[8],j=a[9],l=a[10],m=a[11];e?a!==e&&(e[4]=a[4],e[5]=a[5],e[6]=a[6],e[7]=a[7],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*-c;e[1]=k*b+j*-c;e[2]=h*b+l*-c;e[3]=f* -b+m*-c;e[8]=d*c+g*b;e[9]=k*c+j*b;e[10]=h*c+l*b;e[11]=f*c+m*b;return e},rotateZ:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[4],j=a[5],l=a[6],m=a[7];e?a!==e&&(e[8]=a[8],e[9]=a[9],e[10]=a[10],e[11]=a[11],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*c;e[1]=k*b+j*c;e[2]=h*b+l*c;e[3]=f*b+m*c;e[4]=d*-c+g*b;e[5]=k*-c+j*b;e[6]=h*-c+l*b;e[7]=f*-c+m*b;return e},frustum:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2*d/f;h[1]=0; -h[2]=0;h[3]=0;h[4]=0;h[5]=2*d/g;h[6]=0;h[7]=0;h[8]=(b+a)/f;h[9]=(c+e)/g;h[10]=-(k+d)/j;h[11]=-1;h[12]=0;h[13]=0;h[14]=-(2*k*d)/j;h[15]=0;return h},perspective:function(a,b,e,c,d){a=e*Math.tan(a*Math.PI/360);b*=a;return y.frustum(-b,b,-a,a,e,c,d)},ortho:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2/f;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/g;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/j;h[11]=0;h[12]=-(a+b)/f;h[13]=-(c+e)/g;h[14]=-(k+d)/j;h[15]=1;return h},lookAt:function(a,b,e,c){c|| -(c=y.create());var d,k,h,f,g,j,l,m,n=a[0],p=a[1];a=a[2];h=e[0];f=e[1];k=e[2];l=b[0];e=b[1];d=b[2];if(n===l&&p===e&&a===d)return y.identity(c);b=n-l;e=p-e;l=a-d;m=1/Math.sqrt(b*b+e*e+l*l);b*=m;e*=m;l*=m;d=f*l-k*e;k=k*b-h*l;h=h*e-f*b;(m=Math.sqrt(d*d+k*k+h*h))?(m=1/m,d*=m,k*=m,h*=m):h=k=d=0;f=e*h-l*k;g=l*d-b*h;j=b*k-e*d;(m=Math.sqrt(f*f+g*g+j*j))?(m=1/m,f*=m,g*=m,j*=m):j=g=f=0;c[0]=d;c[1]=f;c[2]=b;c[3]=0;c[4]=k;c[5]=g;c[6]=e;c[7]=0;c[8]=h;c[9]=j;c[10]=l;c[11]=0;c[12]=-(d*n+k*p+h*a);c[13]=-(f*n+g*p+ -j*a);c[14]=-(b*n+e*p+l*a);c[15]=1;return c},fromRotationTranslation:function(a,b,e){e||(e=y.create());var c=a[0],d=a[1],k=a[2],h=a[3],f=c+c,g=d+d,j=k+k;a=c*f;var l=c*g,c=c*j,m=d*g,d=d*j,k=k*j,f=h*f,g=h*g,h=h*j;e[0]=1-(m+k);e[1]=l+h;e[2]=c-g;e[3]=0;e[4]=l-h;e[5]=1-(a+k);e[6]=d+f;e[7]=0;e[8]=c+g;e[9]=d-f;e[10]=1-(a+m);e[11]=0;e[12]=b[0];e[13]=b[1];e[14]=b[2];e[15]=1;return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ -a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},s={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,e,c){var d=new l(4);d[0]=a;d[1]=b;d[2]=e;d[3]=c;return d},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=s.create()); -a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},O=s.identity();s.calculateW=function(a,b){var e=a[0],c=a[1],d=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d)),a;b[0]=e;b[1]=c;b[2]=d;b[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d));return b};s.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};s.inverse=function(a,b){var e=a[0],c=a[1],d=a[2],f=a[3],e=(e=e*e+c*c+d*d+f*f)?1/e:0;if(!b||a===b)return a[0]*=-e,a[1]*=-e,a[2]*=-e,a[3]*=e,a;b[0]=-a[0]*e;b[1]=-a[1]*e;b[2]=-a[2]*e;b[3]=a[3]*e; -return b};s.conjugate=function(a,b){if(!b||a===b)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};s.length=function(a){var b=a[0],e=a[1],c=a[2];a=a[3];return Math.sqrt(b*b+e*e+c*c+a*a)};s.normalize=function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],f=a[3],h=Math.sqrt(e*e+c*c+d*d+f*f);if(0===h)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;h=1/h;b[0]=e*h;b[1]=c*h;b[2]=d*h;b[3]=f*h;return b};s.add=function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+= -b[3],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];e[3]=a[3]+b[3];return e};s.multiply=function(a,b,e){e||(e=a);var c=a[0],d=a[1],f=a[2];a=a[3];var h=b[0],g=b[1],j=b[2];b=b[3];e[0]=c*b+a*h+d*j-f*g;e[1]=d*b+a*g+f*h-c*j;e[2]=f*b+a*j+c*g-d*h;e[3]=a*b-c*h-d*g-f*j;return e};s.multiplyVec3=function(a,b,e){e||(e=b);var c=b[0],d=b[1],f=b[2];b=a[0];var h=a[1],g=a[2];a=a[3];var j=a*c+h*f-g*d,l=a*d+g*c-b*f,m=a*f+b*d-h*c,c=-b*c-h*d-g*f;e[0]=j*a+c*-b+l*-g-m*-h;e[1]=l*a+c*-h+m*-b-j*-g;e[2]=m*a+c*-g+j*-h-l*-b; -return e};s.scale=function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a[3]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;e[3]=a[3]*b;return e};s.toMat3=function(a,b){b||(b=F.create());var e=a[0],c=a[1],d=a[2],f=a[3],h=e+e,g=c+c,j=d+d,l=e*h,m=e*g,e=e*j,n=c*g,c=c*j,d=d*j,h=f*h,g=f*g,f=f*j;b[0]=1-(n+d);b[1]=m+f;b[2]=e-g;b[3]=m-f;b[4]=1-(l+d);b[5]=c+h;b[6]=e+g;b[7]=c-h;b[8]=1-(l+n);return b};s.toMat4=function(a,b){b||(b=y.create());var e=a[0],c=a[1],d=a[2],f=a[3],g=e+e,j=c+c,l=d+d,m=e*g,n=e*j,e=e* -l,p=c*j,c=c*l,d=d*l,g=f*g,j=f*j,f=f*l;b[0]=1-(p+d);b[1]=n+f;b[2]=e-j;b[3]=0;b[4]=n-f;b[5]=1-(m+d);b[6]=c+g;b[7]=0;b[8]=e+j;b[9]=c-g;b[10]=1-(m+p);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};s.slerp=function(a,b,c,d){d||(d=a);var f=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],g,h;if(1<=Math.abs(f))return d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d;g=Math.acos(f);h=Math.sqrt(1-f*f);if(0.001>Math.abs(h))return d[0]=0.5*a[0]+0.5*b[0],d[1]=0.5*a[1]+0.5*b[1],d[2]=0.5*a[2]+0.5*b[2],d[3]=0.5*a[3]+ -0.5*b[3],d;f=Math.sin((1-c)*g)/h;c=Math.sin(c*g)/h;d[0]=a[0]*f+b[0]*c;d[1]=a[1]*f+b[1]*c;d[2]=a[2]*f+b[2]*c;d[3]=a[3]*f+b[3]*c;return d};s.fromRotationMatrix=function(a,b){b||(b=s.create());var c=a[0]+a[4]+a[8],d;if(0a[0]&&(c=1);a[8]>a[3*c+c]&&(c=2);var f=d[c],g=d[f];d=Math.sqrt(a[3*c+c]-a[3*f+f]-a[3*g+g]+1);b[c]=0.5*d;d= -0.5/d;b[3]=(a[3*g+f]-a[3*f+g])*d;b[f]=(a[3*f+c]+a[3*c+f])*d;b[g]=(a[3*g+c]+a[3*c+g])*d}return b};F.toQuat4=s.fromRotationMatrix;var D=F.create();s.fromAxes=function(a,b,c,d){D[0]=b[0];D[3]=b[1];D[6]=b[2];D[1]=c[0];D[4]=c[1];D[7]=c[2];D[2]=a[0];D[5]=a[1];D[8]=a[2];return s.fromRotationMatrix(D,d)};s.identity=function(a){a||(a=s.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};s.fromAngleAxis=function(a,b,c){c||(c=s.create());a*=0.5;var d=Math.sin(a);c[3]=Math.cos(a);c[0]=d*b[0];c[1]=d*b[1];c[2]=d*b[2]; -return c};s.toAngleAxis=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); -b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 -Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],f=a[2],g=a[3],h=c*g-f*d;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-d*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, -b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];c[0]=d*b[0]+f*b[2];c[1]=d*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=d*b+f*h;c[1]=d*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var d=b[0];b=b[1];c[0]=d*a[0]+b*a[1];c[1]=d*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var d=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=d*b;c[2]=f*h;c[3]= -g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,d){var f=new l(4);f[0]=a;f[1]=b;f[2]=c;f[3]=d;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, -b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| -(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)},squaredLength:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};c&&(c.glMatrixArrayType=l,c.MatrixArray=l,c.setMatrixArrayType=d,c.determineMatrixArrayType= -f,c.glMath=g,c.vec2=M,c.vec3=j,c.vec4=N,c.mat2=L,c.mat3=F,c.mat4=y,c.quat4=s);return{glMatrixArrayType:l,MatrixArray:l,setMatrixArrayType:d,determineMatrixArrayType:f,glMath:g,vec2:M,vec3:j,vec4:N,mat2:L,mat3:F,mat4:y,quat4:s}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * vColor;","}"]; -PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"]; -PIXI.CompileVertexShader=function(c,d){for(var f="",g=0;g>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/examples/bunny benchmark/index.html b/examples/bunny benchmark/index.html index 7c5521b..95972c4 100644 --- a/examples/bunny benchmark/index.html +++ b/examples/bunny benchmark/index.html @@ -9,9 +9,10 @@ +
    Click to add more bunnys! Let me know how many you get on screen here @doormat23
    - + diff --git a/examples/bunny benchmark/js/bunnyBenchMark.js b/examples/bunny benchmark/js/bunnyBenchMark.js index a3154eb..c3c8ec5 100644 --- a/examples/bunny benchmark/js/bunnyBenchMark.js +++ b/examples/bunny benchmark/js/bunnyBenchMark.js @@ -22,18 +22,13 @@ var count = 0; var container; +var detail; + function onReady() { - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() + detail = document.getElementById("pixi"); - if(webgl) - { - renderer = new PIXI.WebGLRenderer(); - } - else - { - renderer = new PIXI.CanvasRenderer(480, 320); - } + renderer = PIXI.autoDetectRenderer(); stage = new PIXI.Stage; @@ -46,7 +41,7 @@ stats.domElement.style.top = "0px"; requestAnimFrame(update); - wabbitTexture = new PIXI.Texture("wabbit.png") + wabbitTexture = new PIXI.Texture.fromImage("wabbit.png") counter = document.createElement("div"); counter.className = "counter"; @@ -55,7 +50,6 @@ count = startBunnyCount; counter.innerHTML = count + " BUNNIES"; - container = new PIXI.DisplayObjectContainer(); stage.addChild(container); @@ -114,7 +108,9 @@ minX = 0; maxY = height; minY = 0; - + + detail.style.left = width - 204 + "px"; + detail.style.top = height - 100 + "px"; renderer.resize(width, height); } @@ -126,17 +122,17 @@ { // add 10 at a time :) - for (var i = 0; i < 2; i++) + for (var i = 0; i < 10; i++) { - var bunny = new PIXI.Sprite(wabbitTexture, {x:0, y:0, width:26, height:37}); + var bunny = new PIXI.Sprite(wabbitTexture); bunny.speedX = Math.random() * 10; bunny.speedY = (Math.random() * 10) - 5; bunny.anchor.x = 0.5; bunny.anchor.y = 1; - bunny.alpha = 0.3 + Math.random() * 0.7; + //bunny.alpha = 0.3 + Math.random() * 0.7; bunnys.push(bunny); - bunny.rotation = Math.random() - 0.5; + //bunny.rotation = Math.random() - 0.5; container.addChild(bunny); count++; diff --git a/examples/bunny benchmark/js/pixi.js b/examples/bunny benchmark/js/pixi.js new file mode 100644 index 0000000..65add09 --- /dev/null +++ b/examples/bunny benchmark/js/pixi.js @@ -0,0 +1,110 @@ +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, +d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* +j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= +a[0]-d[0],c=a[1]-d[1];a=a[2]-d[2];d=Math.sqrt(b*b+c*c+a*a);if(!d)return j[0]=0,j[1]=0,j[2]=0,j;d=1/d;j[0]=b*d;j[1]=c*d;j[2]=a*d;return j},lerp:function(a,d,j,b){b||(b=a);b[0]=a[0]+j*(d[0]-a[0]);b[1]=a[1]+j*(d[1]-a[1]);b[2]=a[2]+j*(d[2]-a[2]);return b},dist:function(a,d){var j=d[0]-a[0],b=d[1]-a[1],c=d[2]-a[2];return Math.sqrt(j*j+b*b+c*c)}},p=null,q=new k(4);l.unproject=function(a,d,j,b,c){c||(c=a);p||(p=t.create());var e=p;q[0]=2*(a[0]-b[0])/b[2]-1;q[1]=2*(a[1]-b[1])/b[3]-1;q[2]=2*a[2]-1;q[3]=1; +t.multiply(j,d,e);if(!t.inverse(e))return null;t.multiplyVec4(e,q);if(0===q[3])return null;c[0]=q[0]/q[3];c[1]=q[1]/q[3];c[2]=q[2]/q[3];return c};var C=l.createFrom(1,0,0),F=l.createFrom(0,1,0),u=l.createFrom(0,0,1),w=l.create();l.rotationTo=function(a,d,j){j||(j=m.create());var b=l.dot(a,d);if(1<=b)m.set(H,j);else if(-0.999999>b)l.cross(C,a,w),1E-6>l.length(w)&&l.cross(F,a,w),1E-6>l.length(w)&&l.cross(u,a,w),l.normalize(w),m.fromAngleAxis(Math.PI,w,j);else{var b=Math.sqrt(2*(1+b)),c=1/b;l.cross(a, +d,w);j[0]=w[0]*c;j[1]=w[1]*c;j[2]=w[2]*c;j[3]=0.5*b;m.normalize(j)}1j[3]&&(j[3]=-1);return j};l.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var x={create:function(a){var d=new k(9);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8]):d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=0;return d},createFrom:function(a,d,j,b,c,e,n,f,E){var s=new k(9);s[0]=a;s[1]=d;s[2]=j;s[3]=b;s[4]=c;s[5]=e;s[6]=n;s[7]=f;s[8]=E;return s},determinant:function(a){var d= +a[3],j=a[4],b=a[5],c=a[6],e=a[7],n=a[8];return a[0]*(n*j-b*e)+a[1]*(-n*d+b*c)+a[2]*(e*d-j*c)},inverse:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[3],n=a[4],f=a[5],E=a[6],s=a[7],I=a[8],g=I*n-f*s,h=-I*e+f*E,k=s*e-n*E,r=j*g+b*h+c*k;if(!r)return null;r=1/r;d||(d=x.create());d[0]=g*r;d[1]=(-I*b+c*s)*r;d[2]=(f*b-c*n)*r;d[3]=h*r;d[4]=(I*j-c*E)*r;d[5]=(-f*j+c*e)*r;d[6]=k*r;d[7]=(-s*j+b*E)*r;d[8]=(n*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],D=a[4],E=a[5],s=a[6],I= +a[7];a=a[8];var g=d[0],h=d[1],k=d[2],r=d[3],m=d[4],l=d[5],q=d[6],v=d[7];d=d[8];j[0]=g*b+h*f+k*s;j[1]=g*c+h*D+k*I;j[2]=g*e+h*E+k*a;j[3]=r*b+m*f+l*s;j[4]=r*c+m*D+l*I;j[5]=r*e+m*E+l*a;j[6]=q*b+v*f+d*s;j[7]=q*c+v*D+d*I;j[8]=q*e+v*E+d*a;return j},multiplyVec2:function(a,d,j){j||(j=d);var b=d[0];d=d[1];j[0]=b*a[0]+d*a[3]+a[6];j[1]=b*a[1]+d*a[4]+a[7];return j},multiplyVec3:function(a,d,j){j||(j=d);var b=d[0],c=d[1];d=d[2];j[0]=b*a[0]+c*a[3]+d*a[6];j[1]=b*a[1]+c*a[4]+d*a[7];j[2]=b*a[2]+c*a[5]+d*a[8];return j}, +set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])},identity:function(a){a||(a=x.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, +d){if(!d||a===d){var j=a[1],b=a[2],c=a[5];a[1]=a[3];a[2]=a[6];a[3]=j;a[5]=a[7];a[6]=b;a[7]=c;return a}d[0]=a[0];d[1]=a[3];d[2]=a[6];d[3]=a[1];d[4]=a[4];d[5]=a[7];d[6]=a[2];d[7]=a[5];d[8]=a[8];return d},toMat4:function(a,d){d||(d=t.create());d[15]=1;d[14]=0;d[13]=0;d[12]=0;d[11]=0;d[10]=a[8];d[9]=a[7];d[8]=a[6];d[7]=0;d[6]=a[5];d[5]=a[4];d[4]=a[3];d[3]=0;d[2]=a[2];d[1]=a[1];d[0]=a[0];return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ +a[8]+"]"}},t={create:function(a){var d=new k(16);a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8],d[9]=a[9],d[10]=a[10],d[11]=a[11],d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d},createFrom:function(a,d,j,b,c,e,f,D,E,s,g,h,m,l,r,q){var A=new k(16);A[0]=a;A[1]=d;A[2]=j;A[3]=b;A[4]=c;A[5]=e;A[6]=f;A[7]=D;A[8]=E;A[9]=s;A[10]=g;A[11]=h;A[12]=m;A[13]=l;A[14]=r;A[15]=q;return A},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4]; +d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=a[12];d[13]=a[13];d[14]=a[14];d[15]=a[15];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])&&1E-6>Math.abs(a[9]-d[9])&&1E-6>Math.abs(a[10]-d[10])&&1E-6>Math.abs(a[11]-d[11])&&1E-6>Math.abs(a[12]- +d[12])&&1E-6>Math.abs(a[13]-d[13])&&1E-6>Math.abs(a[14]-d[14])&&1E-6>Math.abs(a[15]-d[15])},identity:function(a){a||(a=t.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,d){if(!d||a===d){var j=a[1],b=a[2],c=a[3],e=a[6],f=a[7],D=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=j;a[6]=a[9];a[7]=a[13];a[8]=b;a[9]=e;a[11]=a[14];a[12]=c;a[13]=f;a[14]=D;return a}d[0]=a[0];d[1]=a[4];d[2]=a[8];d[3]=a[12]; +d[4]=a[1];d[5]=a[5];d[6]=a[9];d[7]=a[13];d[8]=a[2];d[9]=a[6];d[10]=a[10];d[11]=a[14];d[12]=a[3];d[13]=a[7];d[14]=a[11];d[15]=a[15];return d},determinant:function(a){var d=a[0],j=a[1],b=a[2],c=a[3],e=a[4],f=a[5],D=a[6],E=a[7],s=a[8],g=a[9],h=a[10],k=a[11],m=a[12],r=a[13],l=a[14];a=a[15];return m*g*D*c-s*r*D*c-m*f*h*c+e*r*h*c+s*f*l*c-e*g*l*c-m*g*b*E+s*r*b*E+m*j*h*E-d*r*h*E-s*j*l*E+d*g*l*E+m*f*b*k-e*r*b*k-m*j*D*k+d*r*D*k+e*j*l*k-d*f*l*k-s*f*b*a+e*g*b*a+s*j*D*a-d*g*D*a-e*j*h*a+d*f*h*a},inverse:function(a, +d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=a[3],f=a[4],D=a[5],E=a[6],s=a[7],g=a[8],h=a[9],k=a[10],m=a[11],r=a[12],l=a[13],A=a[14],q=a[15],v=j*D-b*f,J=j*E-c*f,y=j*s-e*f,z=b*E-c*D,t=b*s-e*D,u=c*s-e*E,p=g*l-h*r,w=g*A-k*r,x=g*q-m*r,B=h*A-k*l,C=h*q-m*l,F=k*q-m*A,G=v*F-J*C+y*B+z*x-t*w+u*p;if(!G)return null;G=1/G;d[0]=(D*F-E*C+s*B)*G;d[1]=(-b*F+c*C-e*B)*G;d[2]=(l*u-A*t+q*z)*G;d[3]=(-h*u+k*t-m*z)*G;d[4]=(-f*F+E*x-s*w)*G;d[5]=(j*F-c*x+e*w)*G;d[6]=(-r*u+A*y-q*J)*G;d[7]=(g*u-k*y+m*J)*G;d[8]=(f*C-D*x+s*p)*G;d[9]= +(-j*C+b*x-e*p)*G;d[10]=(r*t-l*y+q*v)*G;d[11]=(-g*t+h*y-m*v)*G;d[12]=(-f*B+D*w-E*p)*G;d[13]=(j*B-b*w+c*p)*G;d[14]=(-r*z+l*J-A*v)*G;d[15]=(g*z-h*J+k*v)*G;return d},toRotationMat:function(a,d){d||(d=t.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d},toMat3:function(a,d){d||(d=x.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[4];d[4]=a[5];d[5]=a[6];d[6]=a[8];d[7]=a[9];d[8]=a[10]; +return d},toInverseMat3:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[4],f=a[5],D=a[6],g=a[8],s=a[9],h=a[10],k=h*f-D*s,m=-h*e+D*g,l=s*e-f*g,r=j*k+b*m+c*l;if(!r)return null;r=1/r;d||(d=x.create());d[0]=k*r;d[1]=(-h*b+c*s)*r;d[2]=(D*b-c*f)*r;d[3]=m*r;d[4]=(h*j-c*g)*r;d[5]=(-D*j+c*e)*r;d[6]=l*r;d[7]=(-s*j+b*g)*r;d[8]=(f*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],s=a[6],k=a[7],m=a[8],l=a[9],q=a[10],r=a[11],t=a[12],A=a[13],u=a[14];a=a[15];var v=d[0], +p=d[1],y=d[2],z=d[3];j[0]=v*b+p*g+y*m+z*t;j[1]=v*c+p*h+y*l+z*A;j[2]=v*e+p*s+y*q+z*u;j[3]=v*f+p*k+y*r+z*a;v=d[4];p=d[5];y=d[6];z=d[7];j[4]=v*b+p*g+y*m+z*t;j[5]=v*c+p*h+y*l+z*A;j[6]=v*e+p*s+y*q+z*u;j[7]=v*f+p*k+y*r+z*a;v=d[8];p=d[9];y=d[10];z=d[11];j[8]=v*b+p*g+y*m+z*t;j[9]=v*c+p*h+y*l+z*A;j[10]=v*e+p*s+y*q+z*u;j[11]=v*f+p*k+y*r+z*a;v=d[12];p=d[13];y=d[14];z=d[15];j[12]=v*b+p*g+y*m+z*t;j[13]=v*c+p*h+y*l+z*A;j[14]=v*e+p*s+y*q+z*u;j[15]=v*f+p*k+y*r+z*a;return j},multiplyVec3:function(a,d,b){b||(b=d); +var c=d[0],e=d[1];d=d[2];b[0]=a[0]*c+a[4]*e+a[8]*d+a[12];b[1]=a[1]*c+a[5]*e+a[9]*d+a[13];b[2]=a[2]*c+a[6]*e+a[10]*d+a[14];return b},multiplyVec4:function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=d[3];b[0]=a[0]*c+a[4]*e+a[8]*f+a[12]*d;b[1]=a[1]*c+a[5]*e+a[9]*f+a[13]*d;b[2]=a[2]*c+a[6]*e+a[10]*f+a[14]*d;b[3]=a[3]*c+a[7]*e+a[11]*f+a[15]*d;return b},translate:function(a,d,b){var c=d[0],e=d[1];d=d[2];var f,n,g,h,s,k,m,l,p,r,q,t;if(!b||a===b)return a[12]=a[0]*c+a[4]*e+a[8]*d+a[12],a[13]=a[1]*c+a[5]*e+ +a[9]*d+a[13],a[14]=a[2]*c+a[6]*e+a[10]*d+a[14],a[15]=a[3]*c+a[7]*e+a[11]*d+a[15],a;f=a[0];n=a[1];g=a[2];h=a[3];s=a[4];k=a[5];m=a[6];l=a[7];p=a[8];r=a[9];q=a[10];t=a[11];b[0]=f;b[1]=n;b[2]=g;b[3]=h;b[4]=s;b[5]=k;b[6]=m;b[7]=l;b[8]=p;b[9]=r;b[10]=q;b[11]=t;b[12]=f*c+s*e+p*d+a[12];b[13]=n*c+k*e+r*d+a[13];b[14]=g*c+m*e+q*d+a[14];b[15]=h*c+l*e+t*d+a[15];return b},scale:function(a,d,b){var c=d[0],e=d[1];d=d[2];if(!b||a===b)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=d,a[9]*= +d,a[10]*=d,a[11]*=d,a;b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[7]=a[7]*e;b[8]=a[8]*d;b[9]=a[9]*d;b[10]=a[10]*d;b[11]=a[11]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},rotate:function(a,d,b,c){var e=b[0],f=b[1];b=b[2];var n=Math.sqrt(e*e+f*f+b*b),g,h,k,m,l,p,q,r,t,u,w,v,x,y,z,B,C,F,H,K;if(!n)return null;1!==n&&(n=1/n,e*=n,f*=n,b*=n);g=Math.sin(d);h=Math.cos(d);k=1-h;d=a[0];n=a[1];m=a[2];l=a[3];p=a[4];q=a[5];r=a[6];t=a[7];u=a[8];w=a[9];v= +a[10];x=a[11];y=e*e*k+h;z=f*e*k+b*g;B=b*e*k-f*g;C=e*f*k-b*g;F=f*f*k+h;H=b*f*k+e*g;K=e*b*k+f*g;e=f*b*k-e*g;f=b*b*k+h;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=d*y+p*z+u*B;c[1]=n*y+q*z+w*B;c[2]=m*y+r*z+v*B;c[3]=l*y+t*z+x*B;c[4]=d*C+p*F+u*H;c[5]=n*C+q*F+w*H;c[6]=m*C+r*F+v*H;c[7]=l*C+t*F+x*H;c[8]=d*K+p*e+u*f;c[9]=n*K+q*e+w*f;c[10]=m*K+r*e+v*f;c[11]=l*K+t*e+x*f;return c},rotateX:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[4],f=a[5],n=a[6],g=a[7],h=a[8],k=a[9],m=a[10], +l=a[11];b?a!==b&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[4]=e*d+h*c;b[5]=f*d+k*c;b[6]=n*d+m*c;b[7]=g*d+l*c;b[8]=e*-c+h*d;b[9]=f*-c+k*d;b[10]=n*-c+m*d;b[11]=g*-c+l*d;return b},rotateY:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[8],k=a[9],m=a[10],l=a[11];b?a!==b&&(b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*-c;b[1]=f*d+k*-c;b[2]=n*d+m*-c;b[3]=g* +d+l*-c;b[8]=e*c+h*d;b[9]=f*c+k*d;b[10]=n*c+m*d;b[11]=g*c+l*d;return b},rotateZ:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[4],k=a[5],m=a[6],l=a[7];b?a!==b&&(b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*c;b[1]=f*d+k*c;b[2]=n*d+m*c;b[3]=g*d+l*c;b[4]=e*-c+h*d;b[5]=f*-c+k*d;b[6]=n*-c+m*d;b[7]=g*-c+l*d;return b},frustum:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2*e/g;n[1]=0; +n[2]=0;n[3]=0;n[4]=0;n[5]=2*e/h;n[6]=0;n[7]=0;n[8]=(d+a)/g;n[9]=(c+b)/h;n[10]=-(f+e)/k;n[11]=-1;n[12]=0;n[13]=0;n[14]=-(2*f*e)/k;n[15]=0;return n},perspective:function(a,d,b,c,e){a=b*Math.tan(a*Math.PI/360);d*=a;return t.frustum(-d,d,-a,a,b,c,e)},ortho:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2/g;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=2/h;n[6]=0;n[7]=0;n[8]=0;n[9]=0;n[10]=-2/k;n[11]=0;n[12]=-(a+d)/g;n[13]=-(c+b)/h;n[14]=-(f+e)/k;n[15]=1;return n},lookAt:function(a,d,b,c){c|| +(c=t.create());var e,f,n,g,h,k,m,l,p=a[0],q=a[1];a=a[2];n=b[0];g=b[1];f=b[2];m=d[0];b=d[1];e=d[2];if(p===m&&q===b&&a===e)return t.identity(c);d=p-m;b=q-b;m=a-e;l=1/Math.sqrt(d*d+b*b+m*m);d*=l;b*=l;m*=l;e=g*m-f*b;f=f*d-n*m;n=n*b-g*d;(l=Math.sqrt(e*e+f*f+n*n))?(l=1/l,e*=l,f*=l,n*=l):n=f=e=0;g=b*n-m*f;h=m*e-d*n;k=d*f-b*e;(l=Math.sqrt(g*g+h*h+k*k))?(l=1/l,g*=l,h*=l,k*=l):k=h=g=0;c[0]=e;c[1]=g;c[2]=d;c[3]=0;c[4]=f;c[5]=h;c[6]=b;c[7]=0;c[8]=n;c[9]=k;c[10]=m;c[11]=0;c[12]=-(e*p+f*q+n*a);c[13]=-(g*p+h*q+ +k*a);c[14]=-(d*p+b*q+m*a);c[15]=1;return c},fromRotationTranslation:function(a,d,b){b||(b=t.create());var c=a[0],e=a[1],f=a[2],n=a[3],g=c+c,h=e+e,k=f+f;a=c*g;var l=c*h,c=c*k,m=e*h,e=e*k,f=f*k,g=n*g,h=n*h,n=n*k;b[0]=1-(m+f);b[1]=l+n;b[2]=c-h;b[3]=0;b[4]=l-n;b[5]=1-(a+f);b[6]=e+g;b[7]=0;b[8]=c+h;b[9]=e-g;b[10]=1-(a+m);b[11]=0;b[12]=d[0];b[13]=d[1];b[14]=d[2];b[15]=1;return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ +a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},m={create:function(a){var d=new k(4);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]):d[0]=d[1]=d[2]=d[3]=0;return d},createFrom:function(a,d,b,c){var e=new k(4);e[0]=a;e[1]=d;e[2]=b;e[3]=c;return e},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])},identity:function(a){a||(a=m.create()); +a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},H=m.identity();m.calculateW=function(a,d){var b=a[0],c=a[1],e=a[2];if(!d||a===d)return a[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e)),a;d[0]=b;d[1]=c;d[2]=e;d[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e));return d};m.dot=function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3]};m.inverse=function(a,d){var b=a[0],c=a[1],e=a[2],f=a[3],b=(b=b*b+c*c+e*e+f*f)?1/b:0;if(!d||a===d)return a[0]*=-b,a[1]*=-b,a[2]*=-b,a[3]*=b,a;d[0]=-a[0]*b;d[1]=-a[1]*b;d[2]=-a[2]*b;d[3]=a[3]*b; +return d};m.conjugate=function(a,d){if(!d||a===d)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=a[3];return d};m.length=function(a){var d=a[0],b=a[1],c=a[2];a=a[3];return Math.sqrt(d*d+b*b+c*c+a*a)};m.normalize=function(a,d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=Math.sqrt(b*b+c*c+e*e+f*f);if(0===g)return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d;g=1/g;d[0]=b*g;d[1]=c*g;d[2]=e*g;d[3]=f*g;return d};m.add=function(a,d,b){if(!b||a===b)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a[3]+= +d[3],a;b[0]=a[0]+d[0];b[1]=a[1]+d[1];b[2]=a[2]+d[2];b[3]=a[3]+d[3];return b};m.multiply=function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2];a=a[3];var g=d[0],h=d[1],k=d[2];d=d[3];b[0]=c*d+a*g+e*k-f*h;b[1]=e*d+a*h+f*g-c*k;b[2]=f*d+a*k+c*h-e*g;b[3]=a*d-c*g-e*h-f*k;return b};m.multiplyVec3=function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=a[0];var g=a[1],h=a[2];a=a[3];var k=a*c+g*f-h*e,l=a*e+h*c-d*f,m=a*f+d*e-g*c,c=-d*c-g*e-h*f;b[0]=k*a+c*-d+l*-h-m*-g;b[1]=l*a+c*-g+m*-d-k*-h;b[2]=m*a+c*-h+k*-g-l*-d; +return b};m.scale=function(a,d,b){if(!b||a===b)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a;b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[3]=a[3]*d;return b};m.toMat3=function(a,d){d||(d=x.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b*k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=m-f;d[4]=1-(l+e);d[5]=c+g;d[6]=b+h;d[7]=c-g;d[8]=1-(l+p);return d};m.toMat4=function(a,d){d||(d=t.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b* +k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=0;d[4]=m-f;d[5]=1-(l+e);d[6]=c+g;d[7]=0;d[8]=b+h;d[9]=c-g;d[10]=1-(l+p);d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d};m.slerp=function(a,d,b,c){c||(c=a);var e=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3],f,g;if(1<=Math.abs(e))return c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]),c;f=Math.acos(e);g=Math.sqrt(1-e*e);if(0.0010>Math.abs(g))return c[0]=0.5*a[0]+0.5*d[0],c[1]=0.5*a[1]+0.5*d[1],c[2]=0.5*a[2]+0.5*d[2],c[3]=0.5*a[3]+ +0.5*d[3],c;e=Math.sin((1-b)*f)/g;b=Math.sin(b*f)/g;c[0]=a[0]*e+d[0]*b;c[1]=a[1]*e+d[1]*b;c[2]=a[2]*e+d[2]*b;c[3]=a[3]*e+d[3]*b;return c};m.fromRotationMatrix=function(a,d){d||(d=m.create());var b=a[0]+a[4]+a[8],c;if(0a[0]&&(b=1);a[8]>a[3*b+b]&&(b=2);var e=c[b],f=c[e];c=Math.sqrt(a[3*b+b]-a[3*e+e]-a[3*f+f]+1);d[b]=0.5*c;c= +0.5/c;d[3]=(a[3*f+e]-a[3*e+f])*c;d[e]=(a[3*e+b]+a[3*b+e])*c;d[f]=(a[3*f+b]+a[3*b+f])*c}return d};x.toQuat4=m.fromRotationMatrix;var B=x.create();m.fromAxes=function(a,d,b,c){B[0]=d[0];B[3]=d[1];B[6]=d[2];B[1]=b[0];B[4]=b[1];B[7]=b[2];B[2]=a[0];B[5]=a[1];B[8]=a[2];return m.fromRotationMatrix(B,c)};m.identity=function(a){a||(a=m.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};m.fromAngleAxis=function(a,d,b){b||(b=m.create());a*=0.5;var c=Math.sin(a);b[3]=Math.cos(a);b[0]=c*d[0];b[1]=c*d[1];b[2]=c*d[2]; +return b};m.toAngleAxis=function(a,d){d||(d=a);var b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); +b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 +Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],e=a[1],f=a[2],g=a[3],h=c*g-f*e;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-e*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, +b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];c[0]=e*b[0]+f*b[2];c[1]=e*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=e*b+f*h;c[1]=e*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var e=b[0];b=b[1];c[0]=e*a[0]+b*a[1];c[1]=e*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var e=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=e*b;c[2]=f*h;c[3]= +g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, +b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| +(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= +f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; +PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; +PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l>1);var b=m[0];return b*(1.5-0.5*a*b*b)}}else g.invsqrt=function(a){return 1/Math.sqrt(a)}; -var l=null;f();var j={create:function(a){var b=new l(3);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0;return b},createFrom:function(a,b,e){var c=new l(3);c[0]=a;c[1]=b;c[2]=e;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])},add:function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];return e},subtract:function(a, -b,e){if(!e||a===e)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];return e},multiply:function(a,b,e){if(!e||a===e)return a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a;e[0]=a[0]*b[0];e[1]=a[1]*b[1];e[2]=a[2]*b[2];return e},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;return e},normalize:function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=Math.sqrt(e* -e+c*c+d*d);if(!k)return b[0]=0,b[1]=0,b[2]=0,b;if(1===k)return b[0]=e,b[1]=c,b[2]=d,b;k=1/k;b[0]=e*k;b[1]=c*k;b[2]=d*k;return b},cross:function(a,b,e){e||(e=a);var c=a[0],d=a[1];a=a[2];var k=b[0],h=b[1];b=b[2];e[0]=d*b-a*h;e[1]=a*k-c*b;e[2]=c*h-d*k;return e},length:function(a){var b=a[0],e=a[1];a=a[2];return Math.sqrt(b*b+e*e+a*a)},squaredLength:function(a){var b=a[0],e=a[1];a=a[2];return b*b+e*e+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,b,e){e||(e=a);var c= -a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];b=Math.sqrt(c*c+d*d+a*a);if(!b)return e[0]=0,e[1]=0,e[2]=0,e;b=1/b;e[0]=c*b;e[1]=d*b;e[2]=a*b;return e},lerp:function(a,b,e,c){c||(c=a);c[0]=a[0]+e*(b[0]-a[0]);c[1]=a[1]+e*(b[1]-a[1]);c[2]=a[2]+e*(b[2]-a[2]);return c},dist:function(a,b){var e=b[0]-a[0],c=b[1]-a[1],d=b[2]-a[2];return Math.sqrt(e*e+c*c+d*d)}},x=null,n=new l(4);j.unproject=function(a,b,e,c,d){d||(d=a);x||(x=y.create());var k=x;n[0]=2*(a[0]-c[0])/c[2]-1;n[1]=2*(a[1]-c[1])/c[3]-1;n[2]=2*a[2]-1;n[3]=1; -y.multiply(e,b,k);if(!y.inverse(k))return null;y.multiplyVec4(k,n);if(0===n[3])return null;d[0]=n[0]/n[3];d[1]=n[1]/n[3];d[2]=n[2]/n[3];return d};var z=j.createFrom(1,0,0),A=j.createFrom(0,1,0),H=j.createFrom(0,0,1),C=j.create();j.rotationTo=function(a,b,e){e||(e=s.create());var c=j.dot(a,b);if(1<=c)s.set(O,e);else if(-0.999999>c)j.cross(z,a,C),1E-6>j.length(C)&&j.cross(A,a,C),1E-6>j.length(C)&&j.cross(H,a,C),j.normalize(C),s.fromAngleAxis(Math.PI,C,e);else{var c=Math.sqrt(2*(1+c)),d=1/c;j.cross(a, -b,C);e[0]=C[0]*d;e[1]=C[1]*d;e[2]=C[2]*d;e[3]=0.5*c;s.normalize(e)}1e[3]&&(e[3]=-1);return e};j.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var F={create:function(a){var b=new l(9);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0;return b},createFrom:function(a,b,e,c,d,k,h,E,K){var q=new l(9);q[0]=a;q[1]=b;q[2]=e;q[3]=c;q[4]=d;q[5]=k;q[6]=h;q[7]=E;q[8]=K;return q},determinant:function(a){var b= -a[3],e=a[4],c=a[5],d=a[6],k=a[7],h=a[8];return a[0]*(h*e-c*k)+a[1]*(-h*b+c*d)+a[2]*(k*b-e*d)},inverse:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],E=a[5],K=a[6],q=a[7],f=a[8],g=f*h-E*q,j=-f*k+E*K,J=q*k-h*K,r=e*g+c*j+d*J;if(!r)return null;r=1/r;b||(b=F.create());b[0]=g*r;b[1]=(-f*c+d*q)*r;b[2]=(E*c-d*h)*r;b[3]=j*r;b[4]=(f*e-d*K)*r;b[5]=(-E*e+d*k)*r;b[6]=J*r;b[7]=(-q*e+c*K)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],E=a[4],f=a[5],q=a[6],g= -a[7];a=a[8];var u=b[0],j=b[1],J=b[2],r=b[3],l=b[4],t=b[5],m=b[6],p=b[7];b=b[8];e[0]=u*c+j*h+J*q;e[1]=u*d+j*E+J*g;e[2]=u*k+j*f+J*a;e[3]=r*c+l*h+t*q;e[4]=r*d+l*E+t*g;e[5]=r*k+l*f+t*a;e[6]=m*c+p*h+b*q;e[7]=m*d+p*E+b*g;e[8]=m*k+p*f+b*a;return e},multiplyVec2:function(a,b,e){e||(e=b);var c=b[0];b=b[1];e[0]=c*a[0]+b*a[3]+a[6];e[1]=c*a[1]+b*a[4]+a[7];return e},multiplyVec3:function(a,b,e){e||(e=b);var c=b[0],d=b[1];b=b[2];e[0]=c*a[0]+d*a[3]+b*a[6];e[1]=c*a[1]+d*a[4]+b*a[7];e[2]=c*a[2]+d*a[5]+b*a[8];return e}, -set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])},identity:function(a){a||(a=F.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, -b){if(!b||a===b){var e=a[1],c=a[2],d=a[5];a[1]=a[3];a[2]=a[6];a[3]=e;a[5]=a[7];a[6]=c;a[7]=d;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]=a[8];return b},toMat4:function(a,b){b||(b=y.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ -a[8]+"]"}},y={create:function(a){var b=new l(16);a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]);return b},createFrom:function(a,b,e,c,d,k,h,E,f,q,g,u,j,J,r,m){var t=new l(16);t[0]=a;t[1]=b;t[2]=e;t[3]=c;t[4]=d;t[5]=k;t[6]=h;t[7]=E;t[8]=f;t[9]=q;t[10]=g;t[11]=u;t[12]=j;t[13]=J;t[14]=r;t[15]=m;return t},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4]; -b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])&&1E-6>Math.abs(a[9]-b[9])&&1E-6>Math.abs(a[10]-b[10])&&1E-6>Math.abs(a[11]-b[11])&&1E-6>Math.abs(a[12]- -b[12])&&1E-6>Math.abs(a[13]-b[13])&&1E-6>Math.abs(a[14]-b[14])&&1E-6>Math.abs(a[15]-b[15])},identity:function(a){a||(a=y.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){var e=a[1],c=a[2],d=a[3],k=a[6],h=a[7],E=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=e;a[6]=a[9];a[7]=a[13];a[8]=c;a[9]=k;a[11]=a[14];a[12]=d;a[13]=h;a[14]=E;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12]; -b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b=a[0],e=a[1],c=a[2],d=a[3],k=a[4],h=a[5],E=a[6],f=a[7],g=a[8],I=a[9],u=a[10],j=a[11],l=a[12],r=a[13],m=a[14];a=a[15];return l*I*E*d-g*r*E*d-l*h*u*d+k*r*u*d+g*h*m*d-k*I*m*d-l*I*c*f+g*r*c*f+l*e*u*f-b*r*u*f-g*e*m*f+b*I*m*f+l*h*c*j-k*r*c*j-l*e*E*j+b*r*E*j+k*e*m*j-b*h*m*j-g*h*c*a+k*I*c*a+g*e*E*a-b*I*E*a-k*e*u*a+b*h*u*a},inverse:function(a, -b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],f=a[5],g=a[6],q=a[7],I=a[8],u=a[9],j=a[10],l=a[11],r=a[12],m=a[13],t=a[14],p=a[15],s=e*f-c*h,n=e*g-d*h,v=e*q-k*h,w=c*g-d*f,x=c*q-k*f,y=d*q-k*g,z=I*m-u*r,A=I*t-j*r,C=I*p-l*r,D=u*t-j*m,F=u*p-l*m,H=j*p-l*t,G=s*H-n*F+v*D+w*C-x*A+y*z;if(!G)return null;G=1/G;b[0]=(f*H-g*F+q*D)*G;b[1]=(-c*H+d*F-k*D)*G;b[2]=(m*y-t*x+p*w)*G;b[3]=(-u*y+j*x-l*w)*G;b[4]=(-h*H+g*C-q*A)*G;b[5]=(e*H-d*C+k*A)*G;b[6]=(-r*y+t*v-p*n)*G;b[7]=(I*y-j*v+l*n)*G;b[8]=(h*F-f*C+q*z)*G;b[9]= -(-e*F+c*C-k*z)*G;b[10]=(r*x-m*v+p*s)*G;b[11]=(-I*x+u*v-l*s)*G;b[12]=(-h*D+f*A-g*z)*G;b[13]=(e*D-c*A+d*z)*G;b[14]=(-r*w+m*n-t*s)*G;b[15]=(I*w-u*n+j*s)*G;return b},toRotationMat:function(a,b){b||(b=y.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=F.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10]; -return b},toInverseMat3:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[4],h=a[5],f=a[6],g=a[8],q=a[9],j=a[10],u=j*h-f*q,l=-j*k+f*g,m=q*k-h*g,r=e*u+c*l+d*m;if(!r)return null;r=1/r;b||(b=F.create());b[0]=u*r;b[1]=(-j*c+d*q)*r;b[2]=(f*c-d*h)*r;b[3]=l*r;b[4]=(j*e-d*g)*r;b[5]=(-f*e+d*k)*r;b[6]=m*r;b[7]=(-q*e+c*g)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],f=a[4],g=a[5],q=a[6],j=a[7],u=a[8],l=a[9],m=a[10],r=a[11],p=a[12],t=a[13],s=a[14];a=a[15];var n=b[0], -B=b[1],v=b[2],w=b[3];e[0]=n*c+B*f+v*u+w*p;e[1]=n*d+B*g+v*l+w*t;e[2]=n*k+B*q+v*m+w*s;e[3]=n*h+B*j+v*r+w*a;n=b[4];B=b[5];v=b[6];w=b[7];e[4]=n*c+B*f+v*u+w*p;e[5]=n*d+B*g+v*l+w*t;e[6]=n*k+B*q+v*m+w*s;e[7]=n*h+B*j+v*r+w*a;n=b[8];B=b[9];v=b[10];w=b[11];e[8]=n*c+B*f+v*u+w*p;e[9]=n*d+B*g+v*l+w*t;e[10]=n*k+B*q+v*m+w*s;e[11]=n*h+B*j+v*r+w*a;n=b[12];B=b[13];v=b[14];w=b[15];e[12]=n*c+B*f+v*u+w*p;e[13]=n*d+B*g+v*l+w*t;e[14]=n*k+B*q+v*m+w*s;e[15]=n*h+B*j+v*r+w*a;return e},multiplyVec3:function(a,b,e){e||(e=b); -var c=b[0],d=b[1];b=b[2];e[0]=a[0]*c+a[4]*d+a[8]*b+a[12];e[1]=a[1]*c+a[5]*d+a[9]*b+a[13];e[2]=a[2]*c+a[6]*d+a[10]*b+a[14];return e},multiplyVec4:function(a,b,e){e||(e=b);var c=b[0],d=b[1],k=b[2];b=b[3];e[0]=a[0]*c+a[4]*d+a[8]*k+a[12]*b;e[1]=a[1]*c+a[5]*d+a[9]*k+a[13]*b;e[2]=a[2]*c+a[6]*d+a[10]*k+a[14]*b;e[3]=a[3]*c+a[7]*d+a[11]*k+a[15]*b;return e},translate:function(a,b,e){var c=b[0],d=b[1];b=b[2];var k,h,f,g,q,j,u,l,m,n,p,s;if(!e||a===e)return a[12]=a[0]*c+a[4]*d+a[8]*b+a[12],a[13]=a[1]*c+a[5]*d+ -a[9]*b+a[13],a[14]=a[2]*c+a[6]*d+a[10]*b+a[14],a[15]=a[3]*c+a[7]*d+a[11]*b+a[15],a;k=a[0];h=a[1];f=a[2];g=a[3];q=a[4];j=a[5];u=a[6];l=a[7];m=a[8];n=a[9];p=a[10];s=a[11];e[0]=k;e[1]=h;e[2]=f;e[3]=g;e[4]=q;e[5]=j;e[6]=u;e[7]=l;e[8]=m;e[9]=n;e[10]=p;e[11]=s;e[12]=k*c+q*d+m*b+a[12];e[13]=h*c+j*d+n*b+a[13];e[14]=f*c+u*d+p*b+a[14];e[15]=g*c+l*d+s*b+a[15];return e},scale:function(a,b,e){var c=b[0],d=b[1];b=b[2];if(!e||a===e)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=d,a[5]*=d,a[6]*=d,a[7]*=d,a[8]*=b,a[9]*= -b,a[10]*=b,a[11]*=b,a;e[0]=a[0]*c;e[1]=a[1]*c;e[2]=a[2]*c;e[3]=a[3]*c;e[4]=a[4]*d;e[5]=a[5]*d;e[6]=a[6]*d;e[7]=a[7]*d;e[8]=a[8]*b;e[9]=a[9]*b;e[10]=a[10]*b;e[11]=a[11]*b;e[12]=a[12];e[13]=a[13];e[14]=a[14];e[15]=a[15];return e},rotate:function(a,b,e,c){var d=e[0],k=e[1];e=e[2];var h=Math.sqrt(d*d+k*k+e*e),f,g,q,j,l,m,n,r,p,s,x,y,B,v,w,z,A,C,D,F;if(!h)return null;1!==h&&(h=1/h,d*=h,k*=h,e*=h);f=Math.sin(b);g=Math.cos(b);q=1-g;b=a[0];h=a[1];j=a[2];l=a[3];m=a[4];n=a[5];r=a[6];p=a[7];s=a[8];x=a[9];y= -a[10];B=a[11];v=d*d*q+g;w=k*d*q+e*f;z=e*d*q-k*f;A=d*k*q-e*f;C=k*k*q+g;D=e*k*q+d*f;F=d*e*q+k*f;d=k*e*q-d*f;k=e*e*q+g;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=b*v+m*w+s*z;c[1]=h*v+n*w+x*z;c[2]=j*v+r*w+y*z;c[3]=l*v+p*w+B*z;c[4]=b*A+m*C+s*D;c[5]=h*A+n*C+x*D;c[6]=j*A+r*C+y*D;c[7]=l*A+p*C+B*D;c[8]=b*F+m*d+s*k;c[9]=h*F+n*d+x*k;c[10]=j*F+r*d+y*k;c[11]=l*F+p*d+B*k;return c},rotateX:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[4],k=a[5],h=a[6],f=a[7],g=a[8],q=a[9],j=a[10], -l=a[11];e?a!==e&&(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[4]=d*b+g*c;e[5]=k*b+q*c;e[6]=h*b+j*c;e[7]=f*b+l*c;e[8]=d*-c+g*b;e[9]=k*-c+q*b;e[10]=h*-c+j*b;e[11]=f*-c+l*b;return e},rotateY:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[8],j=a[9],l=a[10],m=a[11];e?a!==e&&(e[4]=a[4],e[5]=a[5],e[6]=a[6],e[7]=a[7],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*-c;e[1]=k*b+j*-c;e[2]=h*b+l*-c;e[3]=f* -b+m*-c;e[8]=d*c+g*b;e[9]=k*c+j*b;e[10]=h*c+l*b;e[11]=f*c+m*b;return e},rotateZ:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[4],j=a[5],l=a[6],m=a[7];e?a!==e&&(e[8]=a[8],e[9]=a[9],e[10]=a[10],e[11]=a[11],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*c;e[1]=k*b+j*c;e[2]=h*b+l*c;e[3]=f*b+m*c;e[4]=d*-c+g*b;e[5]=k*-c+j*b;e[6]=h*-c+l*b;e[7]=f*-c+m*b;return e},frustum:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2*d/f;h[1]=0; -h[2]=0;h[3]=0;h[4]=0;h[5]=2*d/g;h[6]=0;h[7]=0;h[8]=(b+a)/f;h[9]=(c+e)/g;h[10]=-(k+d)/j;h[11]=-1;h[12]=0;h[13]=0;h[14]=-(2*k*d)/j;h[15]=0;return h},perspective:function(a,b,e,c,d){a=e*Math.tan(a*Math.PI/360);b*=a;return y.frustum(-b,b,-a,a,e,c,d)},ortho:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2/f;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/g;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/j;h[11]=0;h[12]=-(a+b)/f;h[13]=-(c+e)/g;h[14]=-(k+d)/j;h[15]=1;return h},lookAt:function(a,b,e,c){c|| -(c=y.create());var d,k,h,f,g,j,l,m,n=a[0],p=a[1];a=a[2];h=e[0];f=e[1];k=e[2];l=b[0];e=b[1];d=b[2];if(n===l&&p===e&&a===d)return y.identity(c);b=n-l;e=p-e;l=a-d;m=1/Math.sqrt(b*b+e*e+l*l);b*=m;e*=m;l*=m;d=f*l-k*e;k=k*b-h*l;h=h*e-f*b;(m=Math.sqrt(d*d+k*k+h*h))?(m=1/m,d*=m,k*=m,h*=m):h=k=d=0;f=e*h-l*k;g=l*d-b*h;j=b*k-e*d;(m=Math.sqrt(f*f+g*g+j*j))?(m=1/m,f*=m,g*=m,j*=m):j=g=f=0;c[0]=d;c[1]=f;c[2]=b;c[3]=0;c[4]=k;c[5]=g;c[6]=e;c[7]=0;c[8]=h;c[9]=j;c[10]=l;c[11]=0;c[12]=-(d*n+k*p+h*a);c[13]=-(f*n+g*p+ -j*a);c[14]=-(b*n+e*p+l*a);c[15]=1;return c},fromRotationTranslation:function(a,b,e){e||(e=y.create());var c=a[0],d=a[1],k=a[2],h=a[3],f=c+c,g=d+d,j=k+k;a=c*f;var l=c*g,c=c*j,m=d*g,d=d*j,k=k*j,f=h*f,g=h*g,h=h*j;e[0]=1-(m+k);e[1]=l+h;e[2]=c-g;e[3]=0;e[4]=l-h;e[5]=1-(a+k);e[6]=d+f;e[7]=0;e[8]=c+g;e[9]=d-f;e[10]=1-(a+m);e[11]=0;e[12]=b[0];e[13]=b[1];e[14]=b[2];e[15]=1;return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ -a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},s={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,e,c){var d=new l(4);d[0]=a;d[1]=b;d[2]=e;d[3]=c;return d},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=s.create()); -a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},O=s.identity();s.calculateW=function(a,b){var e=a[0],c=a[1],d=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d)),a;b[0]=e;b[1]=c;b[2]=d;b[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d));return b};s.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};s.inverse=function(a,b){var e=a[0],c=a[1],d=a[2],f=a[3],e=(e=e*e+c*c+d*d+f*f)?1/e:0;if(!b||a===b)return a[0]*=-e,a[1]*=-e,a[2]*=-e,a[3]*=e,a;b[0]=-a[0]*e;b[1]=-a[1]*e;b[2]=-a[2]*e;b[3]=a[3]*e; -return b};s.conjugate=function(a,b){if(!b||a===b)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};s.length=function(a){var b=a[0],e=a[1],c=a[2];a=a[3];return Math.sqrt(b*b+e*e+c*c+a*a)};s.normalize=function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],f=a[3],h=Math.sqrt(e*e+c*c+d*d+f*f);if(0===h)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;h=1/h;b[0]=e*h;b[1]=c*h;b[2]=d*h;b[3]=f*h;return b};s.add=function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+= -b[3],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];e[3]=a[3]+b[3];return e};s.multiply=function(a,b,e){e||(e=a);var c=a[0],d=a[1],f=a[2];a=a[3];var h=b[0],g=b[1],j=b[2];b=b[3];e[0]=c*b+a*h+d*j-f*g;e[1]=d*b+a*g+f*h-c*j;e[2]=f*b+a*j+c*g-d*h;e[3]=a*b-c*h-d*g-f*j;return e};s.multiplyVec3=function(a,b,e){e||(e=b);var c=b[0],d=b[1],f=b[2];b=a[0];var h=a[1],g=a[2];a=a[3];var j=a*c+h*f-g*d,l=a*d+g*c-b*f,m=a*f+b*d-h*c,c=-b*c-h*d-g*f;e[0]=j*a+c*-b+l*-g-m*-h;e[1]=l*a+c*-h+m*-b-j*-g;e[2]=m*a+c*-g+j*-h-l*-b; -return e};s.scale=function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a[3]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;e[3]=a[3]*b;return e};s.toMat3=function(a,b){b||(b=F.create());var e=a[0],c=a[1],d=a[2],f=a[3],h=e+e,g=c+c,j=d+d,l=e*h,m=e*g,e=e*j,n=c*g,c=c*j,d=d*j,h=f*h,g=f*g,f=f*j;b[0]=1-(n+d);b[1]=m+f;b[2]=e-g;b[3]=m-f;b[4]=1-(l+d);b[5]=c+h;b[6]=e+g;b[7]=c-h;b[8]=1-(l+n);return b};s.toMat4=function(a,b){b||(b=y.create());var e=a[0],c=a[1],d=a[2],f=a[3],g=e+e,j=c+c,l=d+d,m=e*g,n=e*j,e=e* -l,p=c*j,c=c*l,d=d*l,g=f*g,j=f*j,f=f*l;b[0]=1-(p+d);b[1]=n+f;b[2]=e-j;b[3]=0;b[4]=n-f;b[5]=1-(m+d);b[6]=c+g;b[7]=0;b[8]=e+j;b[9]=c-g;b[10]=1-(m+p);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};s.slerp=function(a,b,c,d){d||(d=a);var f=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],g,h;if(1<=Math.abs(f))return d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d;g=Math.acos(f);h=Math.sqrt(1-f*f);if(0.001>Math.abs(h))return d[0]=0.5*a[0]+0.5*b[0],d[1]=0.5*a[1]+0.5*b[1],d[2]=0.5*a[2]+0.5*b[2],d[3]=0.5*a[3]+ -0.5*b[3],d;f=Math.sin((1-c)*g)/h;c=Math.sin(c*g)/h;d[0]=a[0]*f+b[0]*c;d[1]=a[1]*f+b[1]*c;d[2]=a[2]*f+b[2]*c;d[3]=a[3]*f+b[3]*c;return d};s.fromRotationMatrix=function(a,b){b||(b=s.create());var c=a[0]+a[4]+a[8],d;if(0a[0]&&(c=1);a[8]>a[3*c+c]&&(c=2);var f=d[c],g=d[f];d=Math.sqrt(a[3*c+c]-a[3*f+f]-a[3*g+g]+1);b[c]=0.5*d;d= -0.5/d;b[3]=(a[3*g+f]-a[3*f+g])*d;b[f]=(a[3*f+c]+a[3*c+f])*d;b[g]=(a[3*g+c]+a[3*c+g])*d}return b};F.toQuat4=s.fromRotationMatrix;var D=F.create();s.fromAxes=function(a,b,c,d){D[0]=b[0];D[3]=b[1];D[6]=b[2];D[1]=c[0];D[4]=c[1];D[7]=c[2];D[2]=a[0];D[5]=a[1];D[8]=a[2];return s.fromRotationMatrix(D,d)};s.identity=function(a){a||(a=s.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};s.fromAngleAxis=function(a,b,c){c||(c=s.create());a*=0.5;var d=Math.sin(a);c[3]=Math.cos(a);c[0]=d*b[0];c[1]=d*b[1];c[2]=d*b[2]; -return c};s.toAngleAxis=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); -b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 -Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],f=a[2],g=a[3],h=c*g-f*d;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-d*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, -b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];c[0]=d*b[0]+f*b[2];c[1]=d*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=d*b+f*h;c[1]=d*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var d=b[0];b=b[1];c[0]=d*a[0]+b*a[1];c[1]=d*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var d=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=d*b;c[2]=f*h;c[3]= -g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,d){var f=new l(4);f[0]=a;f[1]=b;f[2]=c;f[3]=d;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, -b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| -(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)},squaredLength:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};c&&(c.glMatrixArrayType=l,c.MatrixArray=l,c.setMatrixArrayType=d,c.determineMatrixArrayType= -f,c.glMath=g,c.vec2=M,c.vec3=j,c.vec4=N,c.mat2=L,c.mat3=F,c.mat4=y,c.quat4=s);return{glMatrixArrayType:l,MatrixArray:l,setMatrixArrayType:d,determineMatrixArrayType:f,glMath:g,vec2:M,vec3:j,vec4:N,mat2:L,mat3:F,mat4:y,quat4:s}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * vColor;","}"]; -PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"]; -PIXI.CompileVertexShader=function(c,d){for(var f="",g=0;g>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/examples/bunny benchmark/index.html b/examples/bunny benchmark/index.html index 7c5521b..95972c4 100644 --- a/examples/bunny benchmark/index.html +++ b/examples/bunny benchmark/index.html @@ -9,9 +9,10 @@ +
    Click to add more bunnys! Let me know how many you get on screen here @doormat23
    - + diff --git a/examples/bunny benchmark/js/bunnyBenchMark.js b/examples/bunny benchmark/js/bunnyBenchMark.js index a3154eb..c3c8ec5 100644 --- a/examples/bunny benchmark/js/bunnyBenchMark.js +++ b/examples/bunny benchmark/js/bunnyBenchMark.js @@ -22,18 +22,13 @@ var count = 0; var container; +var detail; + function onReady() { - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() + detail = document.getElementById("pixi"); - if(webgl) - { - renderer = new PIXI.WebGLRenderer(); - } - else - { - renderer = new PIXI.CanvasRenderer(480, 320); - } + renderer = PIXI.autoDetectRenderer(); stage = new PIXI.Stage; @@ -46,7 +41,7 @@ stats.domElement.style.top = "0px"; requestAnimFrame(update); - wabbitTexture = new PIXI.Texture("wabbit.png") + wabbitTexture = new PIXI.Texture.fromImage("wabbit.png") counter = document.createElement("div"); counter.className = "counter"; @@ -55,7 +50,6 @@ count = startBunnyCount; counter.innerHTML = count + " BUNNIES"; - container = new PIXI.DisplayObjectContainer(); stage.addChild(container); @@ -114,7 +108,9 @@ minX = 0; maxY = height; minY = 0; - + + detail.style.left = width - 204 + "px"; + detail.style.top = height - 100 + "px"; renderer.resize(width, height); } @@ -126,17 +122,17 @@ { // add 10 at a time :) - for (var i = 0; i < 2; i++) + for (var i = 0; i < 10; i++) { - var bunny = new PIXI.Sprite(wabbitTexture, {x:0, y:0, width:26, height:37}); + var bunny = new PIXI.Sprite(wabbitTexture); bunny.speedX = Math.random() * 10; bunny.speedY = (Math.random() * 10) - 5; bunny.anchor.x = 0.5; bunny.anchor.y = 1; - bunny.alpha = 0.3 + Math.random() * 0.7; + //bunny.alpha = 0.3 + Math.random() * 0.7; bunnys.push(bunny); - bunny.rotation = Math.random() - 0.5; + //bunny.rotation = Math.random() - 0.5; container.addChild(bunny); count++; diff --git a/examples/bunny benchmark/js/pixi.js b/examples/bunny benchmark/js/pixi.js new file mode 100644 index 0000000..65add09 --- /dev/null +++ b/examples/bunny benchmark/js/pixi.js @@ -0,0 +1,110 @@ +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, +d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* +j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= +a[0]-d[0],c=a[1]-d[1];a=a[2]-d[2];d=Math.sqrt(b*b+c*c+a*a);if(!d)return j[0]=0,j[1]=0,j[2]=0,j;d=1/d;j[0]=b*d;j[1]=c*d;j[2]=a*d;return j},lerp:function(a,d,j,b){b||(b=a);b[0]=a[0]+j*(d[0]-a[0]);b[1]=a[1]+j*(d[1]-a[1]);b[2]=a[2]+j*(d[2]-a[2]);return b},dist:function(a,d){var j=d[0]-a[0],b=d[1]-a[1],c=d[2]-a[2];return Math.sqrt(j*j+b*b+c*c)}},p=null,q=new k(4);l.unproject=function(a,d,j,b,c){c||(c=a);p||(p=t.create());var e=p;q[0]=2*(a[0]-b[0])/b[2]-1;q[1]=2*(a[1]-b[1])/b[3]-1;q[2]=2*a[2]-1;q[3]=1; +t.multiply(j,d,e);if(!t.inverse(e))return null;t.multiplyVec4(e,q);if(0===q[3])return null;c[0]=q[0]/q[3];c[1]=q[1]/q[3];c[2]=q[2]/q[3];return c};var C=l.createFrom(1,0,0),F=l.createFrom(0,1,0),u=l.createFrom(0,0,1),w=l.create();l.rotationTo=function(a,d,j){j||(j=m.create());var b=l.dot(a,d);if(1<=b)m.set(H,j);else if(-0.999999>b)l.cross(C,a,w),1E-6>l.length(w)&&l.cross(F,a,w),1E-6>l.length(w)&&l.cross(u,a,w),l.normalize(w),m.fromAngleAxis(Math.PI,w,j);else{var b=Math.sqrt(2*(1+b)),c=1/b;l.cross(a, +d,w);j[0]=w[0]*c;j[1]=w[1]*c;j[2]=w[2]*c;j[3]=0.5*b;m.normalize(j)}1j[3]&&(j[3]=-1);return j};l.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var x={create:function(a){var d=new k(9);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8]):d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=0;return d},createFrom:function(a,d,j,b,c,e,n,f,E){var s=new k(9);s[0]=a;s[1]=d;s[2]=j;s[3]=b;s[4]=c;s[5]=e;s[6]=n;s[7]=f;s[8]=E;return s},determinant:function(a){var d= +a[3],j=a[4],b=a[5],c=a[6],e=a[7],n=a[8];return a[0]*(n*j-b*e)+a[1]*(-n*d+b*c)+a[2]*(e*d-j*c)},inverse:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[3],n=a[4],f=a[5],E=a[6],s=a[7],I=a[8],g=I*n-f*s,h=-I*e+f*E,k=s*e-n*E,r=j*g+b*h+c*k;if(!r)return null;r=1/r;d||(d=x.create());d[0]=g*r;d[1]=(-I*b+c*s)*r;d[2]=(f*b-c*n)*r;d[3]=h*r;d[4]=(I*j-c*E)*r;d[5]=(-f*j+c*e)*r;d[6]=k*r;d[7]=(-s*j+b*E)*r;d[8]=(n*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],D=a[4],E=a[5],s=a[6],I= +a[7];a=a[8];var g=d[0],h=d[1],k=d[2],r=d[3],m=d[4],l=d[5],q=d[6],v=d[7];d=d[8];j[0]=g*b+h*f+k*s;j[1]=g*c+h*D+k*I;j[2]=g*e+h*E+k*a;j[3]=r*b+m*f+l*s;j[4]=r*c+m*D+l*I;j[5]=r*e+m*E+l*a;j[6]=q*b+v*f+d*s;j[7]=q*c+v*D+d*I;j[8]=q*e+v*E+d*a;return j},multiplyVec2:function(a,d,j){j||(j=d);var b=d[0];d=d[1];j[0]=b*a[0]+d*a[3]+a[6];j[1]=b*a[1]+d*a[4]+a[7];return j},multiplyVec3:function(a,d,j){j||(j=d);var b=d[0],c=d[1];d=d[2];j[0]=b*a[0]+c*a[3]+d*a[6];j[1]=b*a[1]+c*a[4]+d*a[7];j[2]=b*a[2]+c*a[5]+d*a[8];return j}, +set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])},identity:function(a){a||(a=x.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, +d){if(!d||a===d){var j=a[1],b=a[2],c=a[5];a[1]=a[3];a[2]=a[6];a[3]=j;a[5]=a[7];a[6]=b;a[7]=c;return a}d[0]=a[0];d[1]=a[3];d[2]=a[6];d[3]=a[1];d[4]=a[4];d[5]=a[7];d[6]=a[2];d[7]=a[5];d[8]=a[8];return d},toMat4:function(a,d){d||(d=t.create());d[15]=1;d[14]=0;d[13]=0;d[12]=0;d[11]=0;d[10]=a[8];d[9]=a[7];d[8]=a[6];d[7]=0;d[6]=a[5];d[5]=a[4];d[4]=a[3];d[3]=0;d[2]=a[2];d[1]=a[1];d[0]=a[0];return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ +a[8]+"]"}},t={create:function(a){var d=new k(16);a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8],d[9]=a[9],d[10]=a[10],d[11]=a[11],d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d},createFrom:function(a,d,j,b,c,e,f,D,E,s,g,h,m,l,r,q){var A=new k(16);A[0]=a;A[1]=d;A[2]=j;A[3]=b;A[4]=c;A[5]=e;A[6]=f;A[7]=D;A[8]=E;A[9]=s;A[10]=g;A[11]=h;A[12]=m;A[13]=l;A[14]=r;A[15]=q;return A},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4]; +d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=a[12];d[13]=a[13];d[14]=a[14];d[15]=a[15];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])&&1E-6>Math.abs(a[9]-d[9])&&1E-6>Math.abs(a[10]-d[10])&&1E-6>Math.abs(a[11]-d[11])&&1E-6>Math.abs(a[12]- +d[12])&&1E-6>Math.abs(a[13]-d[13])&&1E-6>Math.abs(a[14]-d[14])&&1E-6>Math.abs(a[15]-d[15])},identity:function(a){a||(a=t.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,d){if(!d||a===d){var j=a[1],b=a[2],c=a[3],e=a[6],f=a[7],D=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=j;a[6]=a[9];a[7]=a[13];a[8]=b;a[9]=e;a[11]=a[14];a[12]=c;a[13]=f;a[14]=D;return a}d[0]=a[0];d[1]=a[4];d[2]=a[8];d[3]=a[12]; +d[4]=a[1];d[5]=a[5];d[6]=a[9];d[7]=a[13];d[8]=a[2];d[9]=a[6];d[10]=a[10];d[11]=a[14];d[12]=a[3];d[13]=a[7];d[14]=a[11];d[15]=a[15];return d},determinant:function(a){var d=a[0],j=a[1],b=a[2],c=a[3],e=a[4],f=a[5],D=a[6],E=a[7],s=a[8],g=a[9],h=a[10],k=a[11],m=a[12],r=a[13],l=a[14];a=a[15];return m*g*D*c-s*r*D*c-m*f*h*c+e*r*h*c+s*f*l*c-e*g*l*c-m*g*b*E+s*r*b*E+m*j*h*E-d*r*h*E-s*j*l*E+d*g*l*E+m*f*b*k-e*r*b*k-m*j*D*k+d*r*D*k+e*j*l*k-d*f*l*k-s*f*b*a+e*g*b*a+s*j*D*a-d*g*D*a-e*j*h*a+d*f*h*a},inverse:function(a, +d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=a[3],f=a[4],D=a[5],E=a[6],s=a[7],g=a[8],h=a[9],k=a[10],m=a[11],r=a[12],l=a[13],A=a[14],q=a[15],v=j*D-b*f,J=j*E-c*f,y=j*s-e*f,z=b*E-c*D,t=b*s-e*D,u=c*s-e*E,p=g*l-h*r,w=g*A-k*r,x=g*q-m*r,B=h*A-k*l,C=h*q-m*l,F=k*q-m*A,G=v*F-J*C+y*B+z*x-t*w+u*p;if(!G)return null;G=1/G;d[0]=(D*F-E*C+s*B)*G;d[1]=(-b*F+c*C-e*B)*G;d[2]=(l*u-A*t+q*z)*G;d[3]=(-h*u+k*t-m*z)*G;d[4]=(-f*F+E*x-s*w)*G;d[5]=(j*F-c*x+e*w)*G;d[6]=(-r*u+A*y-q*J)*G;d[7]=(g*u-k*y+m*J)*G;d[8]=(f*C-D*x+s*p)*G;d[9]= +(-j*C+b*x-e*p)*G;d[10]=(r*t-l*y+q*v)*G;d[11]=(-g*t+h*y-m*v)*G;d[12]=(-f*B+D*w-E*p)*G;d[13]=(j*B-b*w+c*p)*G;d[14]=(-r*z+l*J-A*v)*G;d[15]=(g*z-h*J+k*v)*G;return d},toRotationMat:function(a,d){d||(d=t.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d},toMat3:function(a,d){d||(d=x.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[4];d[4]=a[5];d[5]=a[6];d[6]=a[8];d[7]=a[9];d[8]=a[10]; +return d},toInverseMat3:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[4],f=a[5],D=a[6],g=a[8],s=a[9],h=a[10],k=h*f-D*s,m=-h*e+D*g,l=s*e-f*g,r=j*k+b*m+c*l;if(!r)return null;r=1/r;d||(d=x.create());d[0]=k*r;d[1]=(-h*b+c*s)*r;d[2]=(D*b-c*f)*r;d[3]=m*r;d[4]=(h*j-c*g)*r;d[5]=(-D*j+c*e)*r;d[6]=l*r;d[7]=(-s*j+b*g)*r;d[8]=(f*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],s=a[6],k=a[7],m=a[8],l=a[9],q=a[10],r=a[11],t=a[12],A=a[13],u=a[14];a=a[15];var v=d[0], +p=d[1],y=d[2],z=d[3];j[0]=v*b+p*g+y*m+z*t;j[1]=v*c+p*h+y*l+z*A;j[2]=v*e+p*s+y*q+z*u;j[3]=v*f+p*k+y*r+z*a;v=d[4];p=d[5];y=d[6];z=d[7];j[4]=v*b+p*g+y*m+z*t;j[5]=v*c+p*h+y*l+z*A;j[6]=v*e+p*s+y*q+z*u;j[7]=v*f+p*k+y*r+z*a;v=d[8];p=d[9];y=d[10];z=d[11];j[8]=v*b+p*g+y*m+z*t;j[9]=v*c+p*h+y*l+z*A;j[10]=v*e+p*s+y*q+z*u;j[11]=v*f+p*k+y*r+z*a;v=d[12];p=d[13];y=d[14];z=d[15];j[12]=v*b+p*g+y*m+z*t;j[13]=v*c+p*h+y*l+z*A;j[14]=v*e+p*s+y*q+z*u;j[15]=v*f+p*k+y*r+z*a;return j},multiplyVec3:function(a,d,b){b||(b=d); +var c=d[0],e=d[1];d=d[2];b[0]=a[0]*c+a[4]*e+a[8]*d+a[12];b[1]=a[1]*c+a[5]*e+a[9]*d+a[13];b[2]=a[2]*c+a[6]*e+a[10]*d+a[14];return b},multiplyVec4:function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=d[3];b[0]=a[0]*c+a[4]*e+a[8]*f+a[12]*d;b[1]=a[1]*c+a[5]*e+a[9]*f+a[13]*d;b[2]=a[2]*c+a[6]*e+a[10]*f+a[14]*d;b[3]=a[3]*c+a[7]*e+a[11]*f+a[15]*d;return b},translate:function(a,d,b){var c=d[0],e=d[1];d=d[2];var f,n,g,h,s,k,m,l,p,r,q,t;if(!b||a===b)return a[12]=a[0]*c+a[4]*e+a[8]*d+a[12],a[13]=a[1]*c+a[5]*e+ +a[9]*d+a[13],a[14]=a[2]*c+a[6]*e+a[10]*d+a[14],a[15]=a[3]*c+a[7]*e+a[11]*d+a[15],a;f=a[0];n=a[1];g=a[2];h=a[3];s=a[4];k=a[5];m=a[6];l=a[7];p=a[8];r=a[9];q=a[10];t=a[11];b[0]=f;b[1]=n;b[2]=g;b[3]=h;b[4]=s;b[5]=k;b[6]=m;b[7]=l;b[8]=p;b[9]=r;b[10]=q;b[11]=t;b[12]=f*c+s*e+p*d+a[12];b[13]=n*c+k*e+r*d+a[13];b[14]=g*c+m*e+q*d+a[14];b[15]=h*c+l*e+t*d+a[15];return b},scale:function(a,d,b){var c=d[0],e=d[1];d=d[2];if(!b||a===b)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=d,a[9]*= +d,a[10]*=d,a[11]*=d,a;b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[7]=a[7]*e;b[8]=a[8]*d;b[9]=a[9]*d;b[10]=a[10]*d;b[11]=a[11]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},rotate:function(a,d,b,c){var e=b[0],f=b[1];b=b[2];var n=Math.sqrt(e*e+f*f+b*b),g,h,k,m,l,p,q,r,t,u,w,v,x,y,z,B,C,F,H,K;if(!n)return null;1!==n&&(n=1/n,e*=n,f*=n,b*=n);g=Math.sin(d);h=Math.cos(d);k=1-h;d=a[0];n=a[1];m=a[2];l=a[3];p=a[4];q=a[5];r=a[6];t=a[7];u=a[8];w=a[9];v= +a[10];x=a[11];y=e*e*k+h;z=f*e*k+b*g;B=b*e*k-f*g;C=e*f*k-b*g;F=f*f*k+h;H=b*f*k+e*g;K=e*b*k+f*g;e=f*b*k-e*g;f=b*b*k+h;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=d*y+p*z+u*B;c[1]=n*y+q*z+w*B;c[2]=m*y+r*z+v*B;c[3]=l*y+t*z+x*B;c[4]=d*C+p*F+u*H;c[5]=n*C+q*F+w*H;c[6]=m*C+r*F+v*H;c[7]=l*C+t*F+x*H;c[8]=d*K+p*e+u*f;c[9]=n*K+q*e+w*f;c[10]=m*K+r*e+v*f;c[11]=l*K+t*e+x*f;return c},rotateX:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[4],f=a[5],n=a[6],g=a[7],h=a[8],k=a[9],m=a[10], +l=a[11];b?a!==b&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[4]=e*d+h*c;b[5]=f*d+k*c;b[6]=n*d+m*c;b[7]=g*d+l*c;b[8]=e*-c+h*d;b[9]=f*-c+k*d;b[10]=n*-c+m*d;b[11]=g*-c+l*d;return b},rotateY:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[8],k=a[9],m=a[10],l=a[11];b?a!==b&&(b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*-c;b[1]=f*d+k*-c;b[2]=n*d+m*-c;b[3]=g* +d+l*-c;b[8]=e*c+h*d;b[9]=f*c+k*d;b[10]=n*c+m*d;b[11]=g*c+l*d;return b},rotateZ:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[4],k=a[5],m=a[6],l=a[7];b?a!==b&&(b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*c;b[1]=f*d+k*c;b[2]=n*d+m*c;b[3]=g*d+l*c;b[4]=e*-c+h*d;b[5]=f*-c+k*d;b[6]=n*-c+m*d;b[7]=g*-c+l*d;return b},frustum:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2*e/g;n[1]=0; +n[2]=0;n[3]=0;n[4]=0;n[5]=2*e/h;n[6]=0;n[7]=0;n[8]=(d+a)/g;n[9]=(c+b)/h;n[10]=-(f+e)/k;n[11]=-1;n[12]=0;n[13]=0;n[14]=-(2*f*e)/k;n[15]=0;return n},perspective:function(a,d,b,c,e){a=b*Math.tan(a*Math.PI/360);d*=a;return t.frustum(-d,d,-a,a,b,c,e)},ortho:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2/g;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=2/h;n[6]=0;n[7]=0;n[8]=0;n[9]=0;n[10]=-2/k;n[11]=0;n[12]=-(a+d)/g;n[13]=-(c+b)/h;n[14]=-(f+e)/k;n[15]=1;return n},lookAt:function(a,d,b,c){c|| +(c=t.create());var e,f,n,g,h,k,m,l,p=a[0],q=a[1];a=a[2];n=b[0];g=b[1];f=b[2];m=d[0];b=d[1];e=d[2];if(p===m&&q===b&&a===e)return t.identity(c);d=p-m;b=q-b;m=a-e;l=1/Math.sqrt(d*d+b*b+m*m);d*=l;b*=l;m*=l;e=g*m-f*b;f=f*d-n*m;n=n*b-g*d;(l=Math.sqrt(e*e+f*f+n*n))?(l=1/l,e*=l,f*=l,n*=l):n=f=e=0;g=b*n-m*f;h=m*e-d*n;k=d*f-b*e;(l=Math.sqrt(g*g+h*h+k*k))?(l=1/l,g*=l,h*=l,k*=l):k=h=g=0;c[0]=e;c[1]=g;c[2]=d;c[3]=0;c[4]=f;c[5]=h;c[6]=b;c[7]=0;c[8]=n;c[9]=k;c[10]=m;c[11]=0;c[12]=-(e*p+f*q+n*a);c[13]=-(g*p+h*q+ +k*a);c[14]=-(d*p+b*q+m*a);c[15]=1;return c},fromRotationTranslation:function(a,d,b){b||(b=t.create());var c=a[0],e=a[1],f=a[2],n=a[3],g=c+c,h=e+e,k=f+f;a=c*g;var l=c*h,c=c*k,m=e*h,e=e*k,f=f*k,g=n*g,h=n*h,n=n*k;b[0]=1-(m+f);b[1]=l+n;b[2]=c-h;b[3]=0;b[4]=l-n;b[5]=1-(a+f);b[6]=e+g;b[7]=0;b[8]=c+h;b[9]=e-g;b[10]=1-(a+m);b[11]=0;b[12]=d[0];b[13]=d[1];b[14]=d[2];b[15]=1;return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ +a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},m={create:function(a){var d=new k(4);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]):d[0]=d[1]=d[2]=d[3]=0;return d},createFrom:function(a,d,b,c){var e=new k(4);e[0]=a;e[1]=d;e[2]=b;e[3]=c;return e},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])},identity:function(a){a||(a=m.create()); +a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},H=m.identity();m.calculateW=function(a,d){var b=a[0],c=a[1],e=a[2];if(!d||a===d)return a[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e)),a;d[0]=b;d[1]=c;d[2]=e;d[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e));return d};m.dot=function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3]};m.inverse=function(a,d){var b=a[0],c=a[1],e=a[2],f=a[3],b=(b=b*b+c*c+e*e+f*f)?1/b:0;if(!d||a===d)return a[0]*=-b,a[1]*=-b,a[2]*=-b,a[3]*=b,a;d[0]=-a[0]*b;d[1]=-a[1]*b;d[2]=-a[2]*b;d[3]=a[3]*b; +return d};m.conjugate=function(a,d){if(!d||a===d)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=a[3];return d};m.length=function(a){var d=a[0],b=a[1],c=a[2];a=a[3];return Math.sqrt(d*d+b*b+c*c+a*a)};m.normalize=function(a,d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=Math.sqrt(b*b+c*c+e*e+f*f);if(0===g)return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d;g=1/g;d[0]=b*g;d[1]=c*g;d[2]=e*g;d[3]=f*g;return d};m.add=function(a,d,b){if(!b||a===b)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a[3]+= +d[3],a;b[0]=a[0]+d[0];b[1]=a[1]+d[1];b[2]=a[2]+d[2];b[3]=a[3]+d[3];return b};m.multiply=function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2];a=a[3];var g=d[0],h=d[1],k=d[2];d=d[3];b[0]=c*d+a*g+e*k-f*h;b[1]=e*d+a*h+f*g-c*k;b[2]=f*d+a*k+c*h-e*g;b[3]=a*d-c*g-e*h-f*k;return b};m.multiplyVec3=function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=a[0];var g=a[1],h=a[2];a=a[3];var k=a*c+g*f-h*e,l=a*e+h*c-d*f,m=a*f+d*e-g*c,c=-d*c-g*e-h*f;b[0]=k*a+c*-d+l*-h-m*-g;b[1]=l*a+c*-g+m*-d-k*-h;b[2]=m*a+c*-h+k*-g-l*-d; +return b};m.scale=function(a,d,b){if(!b||a===b)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a;b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[3]=a[3]*d;return b};m.toMat3=function(a,d){d||(d=x.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b*k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=m-f;d[4]=1-(l+e);d[5]=c+g;d[6]=b+h;d[7]=c-g;d[8]=1-(l+p);return d};m.toMat4=function(a,d){d||(d=t.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b* +k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=0;d[4]=m-f;d[5]=1-(l+e);d[6]=c+g;d[7]=0;d[8]=b+h;d[9]=c-g;d[10]=1-(l+p);d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d};m.slerp=function(a,d,b,c){c||(c=a);var e=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3],f,g;if(1<=Math.abs(e))return c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]),c;f=Math.acos(e);g=Math.sqrt(1-e*e);if(0.0010>Math.abs(g))return c[0]=0.5*a[0]+0.5*d[0],c[1]=0.5*a[1]+0.5*d[1],c[2]=0.5*a[2]+0.5*d[2],c[3]=0.5*a[3]+ +0.5*d[3],c;e=Math.sin((1-b)*f)/g;b=Math.sin(b*f)/g;c[0]=a[0]*e+d[0]*b;c[1]=a[1]*e+d[1]*b;c[2]=a[2]*e+d[2]*b;c[3]=a[3]*e+d[3]*b;return c};m.fromRotationMatrix=function(a,d){d||(d=m.create());var b=a[0]+a[4]+a[8],c;if(0a[0]&&(b=1);a[8]>a[3*b+b]&&(b=2);var e=c[b],f=c[e];c=Math.sqrt(a[3*b+b]-a[3*e+e]-a[3*f+f]+1);d[b]=0.5*c;c= +0.5/c;d[3]=(a[3*f+e]-a[3*e+f])*c;d[e]=(a[3*e+b]+a[3*b+e])*c;d[f]=(a[3*f+b]+a[3*b+f])*c}return d};x.toQuat4=m.fromRotationMatrix;var B=x.create();m.fromAxes=function(a,d,b,c){B[0]=d[0];B[3]=d[1];B[6]=d[2];B[1]=b[0];B[4]=b[1];B[7]=b[2];B[2]=a[0];B[5]=a[1];B[8]=a[2];return m.fromRotationMatrix(B,c)};m.identity=function(a){a||(a=m.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};m.fromAngleAxis=function(a,d,b){b||(b=m.create());a*=0.5;var c=Math.sin(a);b[3]=Math.cos(a);b[0]=c*d[0];b[1]=c*d[1];b[2]=c*d[2]; +return b};m.toAngleAxis=function(a,d){d||(d=a);var b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); +b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 +Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],e=a[1],f=a[2],g=a[3],h=c*g-f*e;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-e*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, +b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];c[0]=e*b[0]+f*b[2];c[1]=e*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=e*b+f*h;c[1]=e*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var e=b[0];b=b[1];c[0]=e*a[0]+b*a[1];c[1]=e*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var e=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=e*b;c[2]=f*h;c[3]= +g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, +b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| +(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= +f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; +PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; +PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l>1);var b=m[0];return b*(1.5-0.5*a*b*b)}}else g.invsqrt=function(a){return 1/Math.sqrt(a)}; -var l=null;f();var j={create:function(a){var b=new l(3);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0;return b},createFrom:function(a,b,e){var c=new l(3);c[0]=a;c[1]=b;c[2]=e;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])},add:function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];return e},subtract:function(a, -b,e){if(!e||a===e)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];return e},multiply:function(a,b,e){if(!e||a===e)return a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a;e[0]=a[0]*b[0];e[1]=a[1]*b[1];e[2]=a[2]*b[2];return e},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;return e},normalize:function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=Math.sqrt(e* -e+c*c+d*d);if(!k)return b[0]=0,b[1]=0,b[2]=0,b;if(1===k)return b[0]=e,b[1]=c,b[2]=d,b;k=1/k;b[0]=e*k;b[1]=c*k;b[2]=d*k;return b},cross:function(a,b,e){e||(e=a);var c=a[0],d=a[1];a=a[2];var k=b[0],h=b[1];b=b[2];e[0]=d*b-a*h;e[1]=a*k-c*b;e[2]=c*h-d*k;return e},length:function(a){var b=a[0],e=a[1];a=a[2];return Math.sqrt(b*b+e*e+a*a)},squaredLength:function(a){var b=a[0],e=a[1];a=a[2];return b*b+e*e+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,b,e){e||(e=a);var c= -a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];b=Math.sqrt(c*c+d*d+a*a);if(!b)return e[0]=0,e[1]=0,e[2]=0,e;b=1/b;e[0]=c*b;e[1]=d*b;e[2]=a*b;return e},lerp:function(a,b,e,c){c||(c=a);c[0]=a[0]+e*(b[0]-a[0]);c[1]=a[1]+e*(b[1]-a[1]);c[2]=a[2]+e*(b[2]-a[2]);return c},dist:function(a,b){var e=b[0]-a[0],c=b[1]-a[1],d=b[2]-a[2];return Math.sqrt(e*e+c*c+d*d)}},x=null,n=new l(4);j.unproject=function(a,b,e,c,d){d||(d=a);x||(x=y.create());var k=x;n[0]=2*(a[0]-c[0])/c[2]-1;n[1]=2*(a[1]-c[1])/c[3]-1;n[2]=2*a[2]-1;n[3]=1; -y.multiply(e,b,k);if(!y.inverse(k))return null;y.multiplyVec4(k,n);if(0===n[3])return null;d[0]=n[0]/n[3];d[1]=n[1]/n[3];d[2]=n[2]/n[3];return d};var z=j.createFrom(1,0,0),A=j.createFrom(0,1,0),H=j.createFrom(0,0,1),C=j.create();j.rotationTo=function(a,b,e){e||(e=s.create());var c=j.dot(a,b);if(1<=c)s.set(O,e);else if(-0.999999>c)j.cross(z,a,C),1E-6>j.length(C)&&j.cross(A,a,C),1E-6>j.length(C)&&j.cross(H,a,C),j.normalize(C),s.fromAngleAxis(Math.PI,C,e);else{var c=Math.sqrt(2*(1+c)),d=1/c;j.cross(a, -b,C);e[0]=C[0]*d;e[1]=C[1]*d;e[2]=C[2]*d;e[3]=0.5*c;s.normalize(e)}1e[3]&&(e[3]=-1);return e};j.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var F={create:function(a){var b=new l(9);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0;return b},createFrom:function(a,b,e,c,d,k,h,E,K){var q=new l(9);q[0]=a;q[1]=b;q[2]=e;q[3]=c;q[4]=d;q[5]=k;q[6]=h;q[7]=E;q[8]=K;return q},determinant:function(a){var b= -a[3],e=a[4],c=a[5],d=a[6],k=a[7],h=a[8];return a[0]*(h*e-c*k)+a[1]*(-h*b+c*d)+a[2]*(k*b-e*d)},inverse:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],E=a[5],K=a[6],q=a[7],f=a[8],g=f*h-E*q,j=-f*k+E*K,J=q*k-h*K,r=e*g+c*j+d*J;if(!r)return null;r=1/r;b||(b=F.create());b[0]=g*r;b[1]=(-f*c+d*q)*r;b[2]=(E*c-d*h)*r;b[3]=j*r;b[4]=(f*e-d*K)*r;b[5]=(-E*e+d*k)*r;b[6]=J*r;b[7]=(-q*e+c*K)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],E=a[4],f=a[5],q=a[6],g= -a[7];a=a[8];var u=b[0],j=b[1],J=b[2],r=b[3],l=b[4],t=b[5],m=b[6],p=b[7];b=b[8];e[0]=u*c+j*h+J*q;e[1]=u*d+j*E+J*g;e[2]=u*k+j*f+J*a;e[3]=r*c+l*h+t*q;e[4]=r*d+l*E+t*g;e[5]=r*k+l*f+t*a;e[6]=m*c+p*h+b*q;e[7]=m*d+p*E+b*g;e[8]=m*k+p*f+b*a;return e},multiplyVec2:function(a,b,e){e||(e=b);var c=b[0];b=b[1];e[0]=c*a[0]+b*a[3]+a[6];e[1]=c*a[1]+b*a[4]+a[7];return e},multiplyVec3:function(a,b,e){e||(e=b);var c=b[0],d=b[1];b=b[2];e[0]=c*a[0]+d*a[3]+b*a[6];e[1]=c*a[1]+d*a[4]+b*a[7];e[2]=c*a[2]+d*a[5]+b*a[8];return e}, -set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])},identity:function(a){a||(a=F.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, -b){if(!b||a===b){var e=a[1],c=a[2],d=a[5];a[1]=a[3];a[2]=a[6];a[3]=e;a[5]=a[7];a[6]=c;a[7]=d;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]=a[8];return b},toMat4:function(a,b){b||(b=y.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ -a[8]+"]"}},y={create:function(a){var b=new l(16);a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]);return b},createFrom:function(a,b,e,c,d,k,h,E,f,q,g,u,j,J,r,m){var t=new l(16);t[0]=a;t[1]=b;t[2]=e;t[3]=c;t[4]=d;t[5]=k;t[6]=h;t[7]=E;t[8]=f;t[9]=q;t[10]=g;t[11]=u;t[12]=j;t[13]=J;t[14]=r;t[15]=m;return t},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4]; -b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])&&1E-6>Math.abs(a[9]-b[9])&&1E-6>Math.abs(a[10]-b[10])&&1E-6>Math.abs(a[11]-b[11])&&1E-6>Math.abs(a[12]- -b[12])&&1E-6>Math.abs(a[13]-b[13])&&1E-6>Math.abs(a[14]-b[14])&&1E-6>Math.abs(a[15]-b[15])},identity:function(a){a||(a=y.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){var e=a[1],c=a[2],d=a[3],k=a[6],h=a[7],E=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=e;a[6]=a[9];a[7]=a[13];a[8]=c;a[9]=k;a[11]=a[14];a[12]=d;a[13]=h;a[14]=E;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12]; -b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b=a[0],e=a[1],c=a[2],d=a[3],k=a[4],h=a[5],E=a[6],f=a[7],g=a[8],I=a[9],u=a[10],j=a[11],l=a[12],r=a[13],m=a[14];a=a[15];return l*I*E*d-g*r*E*d-l*h*u*d+k*r*u*d+g*h*m*d-k*I*m*d-l*I*c*f+g*r*c*f+l*e*u*f-b*r*u*f-g*e*m*f+b*I*m*f+l*h*c*j-k*r*c*j-l*e*E*j+b*r*E*j+k*e*m*j-b*h*m*j-g*h*c*a+k*I*c*a+g*e*E*a-b*I*E*a-k*e*u*a+b*h*u*a},inverse:function(a, -b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],f=a[5],g=a[6],q=a[7],I=a[8],u=a[9],j=a[10],l=a[11],r=a[12],m=a[13],t=a[14],p=a[15],s=e*f-c*h,n=e*g-d*h,v=e*q-k*h,w=c*g-d*f,x=c*q-k*f,y=d*q-k*g,z=I*m-u*r,A=I*t-j*r,C=I*p-l*r,D=u*t-j*m,F=u*p-l*m,H=j*p-l*t,G=s*H-n*F+v*D+w*C-x*A+y*z;if(!G)return null;G=1/G;b[0]=(f*H-g*F+q*D)*G;b[1]=(-c*H+d*F-k*D)*G;b[2]=(m*y-t*x+p*w)*G;b[3]=(-u*y+j*x-l*w)*G;b[4]=(-h*H+g*C-q*A)*G;b[5]=(e*H-d*C+k*A)*G;b[6]=(-r*y+t*v-p*n)*G;b[7]=(I*y-j*v+l*n)*G;b[8]=(h*F-f*C+q*z)*G;b[9]= -(-e*F+c*C-k*z)*G;b[10]=(r*x-m*v+p*s)*G;b[11]=(-I*x+u*v-l*s)*G;b[12]=(-h*D+f*A-g*z)*G;b[13]=(e*D-c*A+d*z)*G;b[14]=(-r*w+m*n-t*s)*G;b[15]=(I*w-u*n+j*s)*G;return b},toRotationMat:function(a,b){b||(b=y.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=F.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10]; -return b},toInverseMat3:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[4],h=a[5],f=a[6],g=a[8],q=a[9],j=a[10],u=j*h-f*q,l=-j*k+f*g,m=q*k-h*g,r=e*u+c*l+d*m;if(!r)return null;r=1/r;b||(b=F.create());b[0]=u*r;b[1]=(-j*c+d*q)*r;b[2]=(f*c-d*h)*r;b[3]=l*r;b[4]=(j*e-d*g)*r;b[5]=(-f*e+d*k)*r;b[6]=m*r;b[7]=(-q*e+c*g)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],f=a[4],g=a[5],q=a[6],j=a[7],u=a[8],l=a[9],m=a[10],r=a[11],p=a[12],t=a[13],s=a[14];a=a[15];var n=b[0], -B=b[1],v=b[2],w=b[3];e[0]=n*c+B*f+v*u+w*p;e[1]=n*d+B*g+v*l+w*t;e[2]=n*k+B*q+v*m+w*s;e[3]=n*h+B*j+v*r+w*a;n=b[4];B=b[5];v=b[6];w=b[7];e[4]=n*c+B*f+v*u+w*p;e[5]=n*d+B*g+v*l+w*t;e[6]=n*k+B*q+v*m+w*s;e[7]=n*h+B*j+v*r+w*a;n=b[8];B=b[9];v=b[10];w=b[11];e[8]=n*c+B*f+v*u+w*p;e[9]=n*d+B*g+v*l+w*t;e[10]=n*k+B*q+v*m+w*s;e[11]=n*h+B*j+v*r+w*a;n=b[12];B=b[13];v=b[14];w=b[15];e[12]=n*c+B*f+v*u+w*p;e[13]=n*d+B*g+v*l+w*t;e[14]=n*k+B*q+v*m+w*s;e[15]=n*h+B*j+v*r+w*a;return e},multiplyVec3:function(a,b,e){e||(e=b); -var c=b[0],d=b[1];b=b[2];e[0]=a[0]*c+a[4]*d+a[8]*b+a[12];e[1]=a[1]*c+a[5]*d+a[9]*b+a[13];e[2]=a[2]*c+a[6]*d+a[10]*b+a[14];return e},multiplyVec4:function(a,b,e){e||(e=b);var c=b[0],d=b[1],k=b[2];b=b[3];e[0]=a[0]*c+a[4]*d+a[8]*k+a[12]*b;e[1]=a[1]*c+a[5]*d+a[9]*k+a[13]*b;e[2]=a[2]*c+a[6]*d+a[10]*k+a[14]*b;e[3]=a[3]*c+a[7]*d+a[11]*k+a[15]*b;return e},translate:function(a,b,e){var c=b[0],d=b[1];b=b[2];var k,h,f,g,q,j,u,l,m,n,p,s;if(!e||a===e)return a[12]=a[0]*c+a[4]*d+a[8]*b+a[12],a[13]=a[1]*c+a[5]*d+ -a[9]*b+a[13],a[14]=a[2]*c+a[6]*d+a[10]*b+a[14],a[15]=a[3]*c+a[7]*d+a[11]*b+a[15],a;k=a[0];h=a[1];f=a[2];g=a[3];q=a[4];j=a[5];u=a[6];l=a[7];m=a[8];n=a[9];p=a[10];s=a[11];e[0]=k;e[1]=h;e[2]=f;e[3]=g;e[4]=q;e[5]=j;e[6]=u;e[7]=l;e[8]=m;e[9]=n;e[10]=p;e[11]=s;e[12]=k*c+q*d+m*b+a[12];e[13]=h*c+j*d+n*b+a[13];e[14]=f*c+u*d+p*b+a[14];e[15]=g*c+l*d+s*b+a[15];return e},scale:function(a,b,e){var c=b[0],d=b[1];b=b[2];if(!e||a===e)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=d,a[5]*=d,a[6]*=d,a[7]*=d,a[8]*=b,a[9]*= -b,a[10]*=b,a[11]*=b,a;e[0]=a[0]*c;e[1]=a[1]*c;e[2]=a[2]*c;e[3]=a[3]*c;e[4]=a[4]*d;e[5]=a[5]*d;e[6]=a[6]*d;e[7]=a[7]*d;e[8]=a[8]*b;e[9]=a[9]*b;e[10]=a[10]*b;e[11]=a[11]*b;e[12]=a[12];e[13]=a[13];e[14]=a[14];e[15]=a[15];return e},rotate:function(a,b,e,c){var d=e[0],k=e[1];e=e[2];var h=Math.sqrt(d*d+k*k+e*e),f,g,q,j,l,m,n,r,p,s,x,y,B,v,w,z,A,C,D,F;if(!h)return null;1!==h&&(h=1/h,d*=h,k*=h,e*=h);f=Math.sin(b);g=Math.cos(b);q=1-g;b=a[0];h=a[1];j=a[2];l=a[3];m=a[4];n=a[5];r=a[6];p=a[7];s=a[8];x=a[9];y= -a[10];B=a[11];v=d*d*q+g;w=k*d*q+e*f;z=e*d*q-k*f;A=d*k*q-e*f;C=k*k*q+g;D=e*k*q+d*f;F=d*e*q+k*f;d=k*e*q-d*f;k=e*e*q+g;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=b*v+m*w+s*z;c[1]=h*v+n*w+x*z;c[2]=j*v+r*w+y*z;c[3]=l*v+p*w+B*z;c[4]=b*A+m*C+s*D;c[5]=h*A+n*C+x*D;c[6]=j*A+r*C+y*D;c[7]=l*A+p*C+B*D;c[8]=b*F+m*d+s*k;c[9]=h*F+n*d+x*k;c[10]=j*F+r*d+y*k;c[11]=l*F+p*d+B*k;return c},rotateX:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[4],k=a[5],h=a[6],f=a[7],g=a[8],q=a[9],j=a[10], -l=a[11];e?a!==e&&(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[4]=d*b+g*c;e[5]=k*b+q*c;e[6]=h*b+j*c;e[7]=f*b+l*c;e[8]=d*-c+g*b;e[9]=k*-c+q*b;e[10]=h*-c+j*b;e[11]=f*-c+l*b;return e},rotateY:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[8],j=a[9],l=a[10],m=a[11];e?a!==e&&(e[4]=a[4],e[5]=a[5],e[6]=a[6],e[7]=a[7],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*-c;e[1]=k*b+j*-c;e[2]=h*b+l*-c;e[3]=f* -b+m*-c;e[8]=d*c+g*b;e[9]=k*c+j*b;e[10]=h*c+l*b;e[11]=f*c+m*b;return e},rotateZ:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[4],j=a[5],l=a[6],m=a[7];e?a!==e&&(e[8]=a[8],e[9]=a[9],e[10]=a[10],e[11]=a[11],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*c;e[1]=k*b+j*c;e[2]=h*b+l*c;e[3]=f*b+m*c;e[4]=d*-c+g*b;e[5]=k*-c+j*b;e[6]=h*-c+l*b;e[7]=f*-c+m*b;return e},frustum:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2*d/f;h[1]=0; -h[2]=0;h[3]=0;h[4]=0;h[5]=2*d/g;h[6]=0;h[7]=0;h[8]=(b+a)/f;h[9]=(c+e)/g;h[10]=-(k+d)/j;h[11]=-1;h[12]=0;h[13]=0;h[14]=-(2*k*d)/j;h[15]=0;return h},perspective:function(a,b,e,c,d){a=e*Math.tan(a*Math.PI/360);b*=a;return y.frustum(-b,b,-a,a,e,c,d)},ortho:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2/f;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/g;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/j;h[11]=0;h[12]=-(a+b)/f;h[13]=-(c+e)/g;h[14]=-(k+d)/j;h[15]=1;return h},lookAt:function(a,b,e,c){c|| -(c=y.create());var d,k,h,f,g,j,l,m,n=a[0],p=a[1];a=a[2];h=e[0];f=e[1];k=e[2];l=b[0];e=b[1];d=b[2];if(n===l&&p===e&&a===d)return y.identity(c);b=n-l;e=p-e;l=a-d;m=1/Math.sqrt(b*b+e*e+l*l);b*=m;e*=m;l*=m;d=f*l-k*e;k=k*b-h*l;h=h*e-f*b;(m=Math.sqrt(d*d+k*k+h*h))?(m=1/m,d*=m,k*=m,h*=m):h=k=d=0;f=e*h-l*k;g=l*d-b*h;j=b*k-e*d;(m=Math.sqrt(f*f+g*g+j*j))?(m=1/m,f*=m,g*=m,j*=m):j=g=f=0;c[0]=d;c[1]=f;c[2]=b;c[3]=0;c[4]=k;c[5]=g;c[6]=e;c[7]=0;c[8]=h;c[9]=j;c[10]=l;c[11]=0;c[12]=-(d*n+k*p+h*a);c[13]=-(f*n+g*p+ -j*a);c[14]=-(b*n+e*p+l*a);c[15]=1;return c},fromRotationTranslation:function(a,b,e){e||(e=y.create());var c=a[0],d=a[1],k=a[2],h=a[3],f=c+c,g=d+d,j=k+k;a=c*f;var l=c*g,c=c*j,m=d*g,d=d*j,k=k*j,f=h*f,g=h*g,h=h*j;e[0]=1-(m+k);e[1]=l+h;e[2]=c-g;e[3]=0;e[4]=l-h;e[5]=1-(a+k);e[6]=d+f;e[7]=0;e[8]=c+g;e[9]=d-f;e[10]=1-(a+m);e[11]=0;e[12]=b[0];e[13]=b[1];e[14]=b[2];e[15]=1;return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ -a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},s={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,e,c){var d=new l(4);d[0]=a;d[1]=b;d[2]=e;d[3]=c;return d},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=s.create()); -a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},O=s.identity();s.calculateW=function(a,b){var e=a[0],c=a[1],d=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d)),a;b[0]=e;b[1]=c;b[2]=d;b[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d));return b};s.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};s.inverse=function(a,b){var e=a[0],c=a[1],d=a[2],f=a[3],e=(e=e*e+c*c+d*d+f*f)?1/e:0;if(!b||a===b)return a[0]*=-e,a[1]*=-e,a[2]*=-e,a[3]*=e,a;b[0]=-a[0]*e;b[1]=-a[1]*e;b[2]=-a[2]*e;b[3]=a[3]*e; -return b};s.conjugate=function(a,b){if(!b||a===b)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};s.length=function(a){var b=a[0],e=a[1],c=a[2];a=a[3];return Math.sqrt(b*b+e*e+c*c+a*a)};s.normalize=function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],f=a[3],h=Math.sqrt(e*e+c*c+d*d+f*f);if(0===h)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;h=1/h;b[0]=e*h;b[1]=c*h;b[2]=d*h;b[3]=f*h;return b};s.add=function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+= -b[3],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];e[3]=a[3]+b[3];return e};s.multiply=function(a,b,e){e||(e=a);var c=a[0],d=a[1],f=a[2];a=a[3];var h=b[0],g=b[1],j=b[2];b=b[3];e[0]=c*b+a*h+d*j-f*g;e[1]=d*b+a*g+f*h-c*j;e[2]=f*b+a*j+c*g-d*h;e[3]=a*b-c*h-d*g-f*j;return e};s.multiplyVec3=function(a,b,e){e||(e=b);var c=b[0],d=b[1],f=b[2];b=a[0];var h=a[1],g=a[2];a=a[3];var j=a*c+h*f-g*d,l=a*d+g*c-b*f,m=a*f+b*d-h*c,c=-b*c-h*d-g*f;e[0]=j*a+c*-b+l*-g-m*-h;e[1]=l*a+c*-h+m*-b-j*-g;e[2]=m*a+c*-g+j*-h-l*-b; -return e};s.scale=function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a[3]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;e[3]=a[3]*b;return e};s.toMat3=function(a,b){b||(b=F.create());var e=a[0],c=a[1],d=a[2],f=a[3],h=e+e,g=c+c,j=d+d,l=e*h,m=e*g,e=e*j,n=c*g,c=c*j,d=d*j,h=f*h,g=f*g,f=f*j;b[0]=1-(n+d);b[1]=m+f;b[2]=e-g;b[3]=m-f;b[4]=1-(l+d);b[5]=c+h;b[6]=e+g;b[7]=c-h;b[8]=1-(l+n);return b};s.toMat4=function(a,b){b||(b=y.create());var e=a[0],c=a[1],d=a[2],f=a[3],g=e+e,j=c+c,l=d+d,m=e*g,n=e*j,e=e* -l,p=c*j,c=c*l,d=d*l,g=f*g,j=f*j,f=f*l;b[0]=1-(p+d);b[1]=n+f;b[2]=e-j;b[3]=0;b[4]=n-f;b[5]=1-(m+d);b[6]=c+g;b[7]=0;b[8]=e+j;b[9]=c-g;b[10]=1-(m+p);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};s.slerp=function(a,b,c,d){d||(d=a);var f=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],g,h;if(1<=Math.abs(f))return d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d;g=Math.acos(f);h=Math.sqrt(1-f*f);if(0.001>Math.abs(h))return d[0]=0.5*a[0]+0.5*b[0],d[1]=0.5*a[1]+0.5*b[1],d[2]=0.5*a[2]+0.5*b[2],d[3]=0.5*a[3]+ -0.5*b[3],d;f=Math.sin((1-c)*g)/h;c=Math.sin(c*g)/h;d[0]=a[0]*f+b[0]*c;d[1]=a[1]*f+b[1]*c;d[2]=a[2]*f+b[2]*c;d[3]=a[3]*f+b[3]*c;return d};s.fromRotationMatrix=function(a,b){b||(b=s.create());var c=a[0]+a[4]+a[8],d;if(0a[0]&&(c=1);a[8]>a[3*c+c]&&(c=2);var f=d[c],g=d[f];d=Math.sqrt(a[3*c+c]-a[3*f+f]-a[3*g+g]+1);b[c]=0.5*d;d= -0.5/d;b[3]=(a[3*g+f]-a[3*f+g])*d;b[f]=(a[3*f+c]+a[3*c+f])*d;b[g]=(a[3*g+c]+a[3*c+g])*d}return b};F.toQuat4=s.fromRotationMatrix;var D=F.create();s.fromAxes=function(a,b,c,d){D[0]=b[0];D[3]=b[1];D[6]=b[2];D[1]=c[0];D[4]=c[1];D[7]=c[2];D[2]=a[0];D[5]=a[1];D[8]=a[2];return s.fromRotationMatrix(D,d)};s.identity=function(a){a||(a=s.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};s.fromAngleAxis=function(a,b,c){c||(c=s.create());a*=0.5;var d=Math.sin(a);c[3]=Math.cos(a);c[0]=d*b[0];c[1]=d*b[1];c[2]=d*b[2]; -return c};s.toAngleAxis=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); -b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 -Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],f=a[2],g=a[3],h=c*g-f*d;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-d*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, -b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];c[0]=d*b[0]+f*b[2];c[1]=d*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=d*b+f*h;c[1]=d*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var d=b[0];b=b[1];c[0]=d*a[0]+b*a[1];c[1]=d*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var d=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=d*b;c[2]=f*h;c[3]= -g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,d){var f=new l(4);f[0]=a;f[1]=b;f[2]=c;f[3]=d;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, -b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| -(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)},squaredLength:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};c&&(c.glMatrixArrayType=l,c.MatrixArray=l,c.setMatrixArrayType=d,c.determineMatrixArrayType= -f,c.glMath=g,c.vec2=M,c.vec3=j,c.vec4=N,c.mat2=L,c.mat3=F,c.mat4=y,c.quat4=s);return{glMatrixArrayType:l,MatrixArray:l,setMatrixArrayType:d,determineMatrixArrayType:f,glMath:g,vec2:M,vec3:j,vec4:N,mat2:L,mat3:F,mat4:y,quat4:s}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * vColor;","}"]; -PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"]; -PIXI.CompileVertexShader=function(c,d){for(var f="",g=0;g>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/examples/bunny benchmark/index.html b/examples/bunny benchmark/index.html index 7c5521b..95972c4 100644 --- a/examples/bunny benchmark/index.html +++ b/examples/bunny benchmark/index.html @@ -9,9 +9,10 @@ +
    Click to add more bunnys! Let me know how many you get on screen here @doormat23
    - + diff --git a/examples/bunny benchmark/js/bunnyBenchMark.js b/examples/bunny benchmark/js/bunnyBenchMark.js index a3154eb..c3c8ec5 100644 --- a/examples/bunny benchmark/js/bunnyBenchMark.js +++ b/examples/bunny benchmark/js/bunnyBenchMark.js @@ -22,18 +22,13 @@ var count = 0; var container; +var detail; + function onReady() { - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() + detail = document.getElementById("pixi"); - if(webgl) - { - renderer = new PIXI.WebGLRenderer(); - } - else - { - renderer = new PIXI.CanvasRenderer(480, 320); - } + renderer = PIXI.autoDetectRenderer(); stage = new PIXI.Stage; @@ -46,7 +41,7 @@ stats.domElement.style.top = "0px"; requestAnimFrame(update); - wabbitTexture = new PIXI.Texture("wabbit.png") + wabbitTexture = new PIXI.Texture.fromImage("wabbit.png") counter = document.createElement("div"); counter.className = "counter"; @@ -55,7 +50,6 @@ count = startBunnyCount; counter.innerHTML = count + " BUNNIES"; - container = new PIXI.DisplayObjectContainer(); stage.addChild(container); @@ -114,7 +108,9 @@ minX = 0; maxY = height; minY = 0; - + + detail.style.left = width - 204 + "px"; + detail.style.top = height - 100 + "px"; renderer.resize(width, height); } @@ -126,17 +122,17 @@ { // add 10 at a time :) - for (var i = 0; i < 2; i++) + for (var i = 0; i < 10; i++) { - var bunny = new PIXI.Sprite(wabbitTexture, {x:0, y:0, width:26, height:37}); + var bunny = new PIXI.Sprite(wabbitTexture); bunny.speedX = Math.random() * 10; bunny.speedY = (Math.random() * 10) - 5; bunny.anchor.x = 0.5; bunny.anchor.y = 1; - bunny.alpha = 0.3 + Math.random() * 0.7; + //bunny.alpha = 0.3 + Math.random() * 0.7; bunnys.push(bunny); - bunny.rotation = Math.random() - 0.5; + //bunny.rotation = Math.random() - 0.5; container.addChild(bunny); count++; diff --git a/examples/bunny benchmark/js/pixi.js b/examples/bunny benchmark/js/pixi.js new file mode 100644 index 0000000..65add09 --- /dev/null +++ b/examples/bunny benchmark/js/pixi.js @@ -0,0 +1,110 @@ +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, +d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* +j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= +a[0]-d[0],c=a[1]-d[1];a=a[2]-d[2];d=Math.sqrt(b*b+c*c+a*a);if(!d)return j[0]=0,j[1]=0,j[2]=0,j;d=1/d;j[0]=b*d;j[1]=c*d;j[2]=a*d;return j},lerp:function(a,d,j,b){b||(b=a);b[0]=a[0]+j*(d[0]-a[0]);b[1]=a[1]+j*(d[1]-a[1]);b[2]=a[2]+j*(d[2]-a[2]);return b},dist:function(a,d){var j=d[0]-a[0],b=d[1]-a[1],c=d[2]-a[2];return Math.sqrt(j*j+b*b+c*c)}},p=null,q=new k(4);l.unproject=function(a,d,j,b,c){c||(c=a);p||(p=t.create());var e=p;q[0]=2*(a[0]-b[0])/b[2]-1;q[1]=2*(a[1]-b[1])/b[3]-1;q[2]=2*a[2]-1;q[3]=1; +t.multiply(j,d,e);if(!t.inverse(e))return null;t.multiplyVec4(e,q);if(0===q[3])return null;c[0]=q[0]/q[3];c[1]=q[1]/q[3];c[2]=q[2]/q[3];return c};var C=l.createFrom(1,0,0),F=l.createFrom(0,1,0),u=l.createFrom(0,0,1),w=l.create();l.rotationTo=function(a,d,j){j||(j=m.create());var b=l.dot(a,d);if(1<=b)m.set(H,j);else if(-0.999999>b)l.cross(C,a,w),1E-6>l.length(w)&&l.cross(F,a,w),1E-6>l.length(w)&&l.cross(u,a,w),l.normalize(w),m.fromAngleAxis(Math.PI,w,j);else{var b=Math.sqrt(2*(1+b)),c=1/b;l.cross(a, +d,w);j[0]=w[0]*c;j[1]=w[1]*c;j[2]=w[2]*c;j[3]=0.5*b;m.normalize(j)}1j[3]&&(j[3]=-1);return j};l.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var x={create:function(a){var d=new k(9);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8]):d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=0;return d},createFrom:function(a,d,j,b,c,e,n,f,E){var s=new k(9);s[0]=a;s[1]=d;s[2]=j;s[3]=b;s[4]=c;s[5]=e;s[6]=n;s[7]=f;s[8]=E;return s},determinant:function(a){var d= +a[3],j=a[4],b=a[5],c=a[6],e=a[7],n=a[8];return a[0]*(n*j-b*e)+a[1]*(-n*d+b*c)+a[2]*(e*d-j*c)},inverse:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[3],n=a[4],f=a[5],E=a[6],s=a[7],I=a[8],g=I*n-f*s,h=-I*e+f*E,k=s*e-n*E,r=j*g+b*h+c*k;if(!r)return null;r=1/r;d||(d=x.create());d[0]=g*r;d[1]=(-I*b+c*s)*r;d[2]=(f*b-c*n)*r;d[3]=h*r;d[4]=(I*j-c*E)*r;d[5]=(-f*j+c*e)*r;d[6]=k*r;d[7]=(-s*j+b*E)*r;d[8]=(n*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],D=a[4],E=a[5],s=a[6],I= +a[7];a=a[8];var g=d[0],h=d[1],k=d[2],r=d[3],m=d[4],l=d[5],q=d[6],v=d[7];d=d[8];j[0]=g*b+h*f+k*s;j[1]=g*c+h*D+k*I;j[2]=g*e+h*E+k*a;j[3]=r*b+m*f+l*s;j[4]=r*c+m*D+l*I;j[5]=r*e+m*E+l*a;j[6]=q*b+v*f+d*s;j[7]=q*c+v*D+d*I;j[8]=q*e+v*E+d*a;return j},multiplyVec2:function(a,d,j){j||(j=d);var b=d[0];d=d[1];j[0]=b*a[0]+d*a[3]+a[6];j[1]=b*a[1]+d*a[4]+a[7];return j},multiplyVec3:function(a,d,j){j||(j=d);var b=d[0],c=d[1];d=d[2];j[0]=b*a[0]+c*a[3]+d*a[6];j[1]=b*a[1]+c*a[4]+d*a[7];j[2]=b*a[2]+c*a[5]+d*a[8];return j}, +set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])},identity:function(a){a||(a=x.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, +d){if(!d||a===d){var j=a[1],b=a[2],c=a[5];a[1]=a[3];a[2]=a[6];a[3]=j;a[5]=a[7];a[6]=b;a[7]=c;return a}d[0]=a[0];d[1]=a[3];d[2]=a[6];d[3]=a[1];d[4]=a[4];d[5]=a[7];d[6]=a[2];d[7]=a[5];d[8]=a[8];return d},toMat4:function(a,d){d||(d=t.create());d[15]=1;d[14]=0;d[13]=0;d[12]=0;d[11]=0;d[10]=a[8];d[9]=a[7];d[8]=a[6];d[7]=0;d[6]=a[5];d[5]=a[4];d[4]=a[3];d[3]=0;d[2]=a[2];d[1]=a[1];d[0]=a[0];return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ +a[8]+"]"}},t={create:function(a){var d=new k(16);a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8],d[9]=a[9],d[10]=a[10],d[11]=a[11],d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d},createFrom:function(a,d,j,b,c,e,f,D,E,s,g,h,m,l,r,q){var A=new k(16);A[0]=a;A[1]=d;A[2]=j;A[3]=b;A[4]=c;A[5]=e;A[6]=f;A[7]=D;A[8]=E;A[9]=s;A[10]=g;A[11]=h;A[12]=m;A[13]=l;A[14]=r;A[15]=q;return A},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4]; +d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=a[12];d[13]=a[13];d[14]=a[14];d[15]=a[15];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])&&1E-6>Math.abs(a[9]-d[9])&&1E-6>Math.abs(a[10]-d[10])&&1E-6>Math.abs(a[11]-d[11])&&1E-6>Math.abs(a[12]- +d[12])&&1E-6>Math.abs(a[13]-d[13])&&1E-6>Math.abs(a[14]-d[14])&&1E-6>Math.abs(a[15]-d[15])},identity:function(a){a||(a=t.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,d){if(!d||a===d){var j=a[1],b=a[2],c=a[3],e=a[6],f=a[7],D=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=j;a[6]=a[9];a[7]=a[13];a[8]=b;a[9]=e;a[11]=a[14];a[12]=c;a[13]=f;a[14]=D;return a}d[0]=a[0];d[1]=a[4];d[2]=a[8];d[3]=a[12]; +d[4]=a[1];d[5]=a[5];d[6]=a[9];d[7]=a[13];d[8]=a[2];d[9]=a[6];d[10]=a[10];d[11]=a[14];d[12]=a[3];d[13]=a[7];d[14]=a[11];d[15]=a[15];return d},determinant:function(a){var d=a[0],j=a[1],b=a[2],c=a[3],e=a[4],f=a[5],D=a[6],E=a[7],s=a[8],g=a[9],h=a[10],k=a[11],m=a[12],r=a[13],l=a[14];a=a[15];return m*g*D*c-s*r*D*c-m*f*h*c+e*r*h*c+s*f*l*c-e*g*l*c-m*g*b*E+s*r*b*E+m*j*h*E-d*r*h*E-s*j*l*E+d*g*l*E+m*f*b*k-e*r*b*k-m*j*D*k+d*r*D*k+e*j*l*k-d*f*l*k-s*f*b*a+e*g*b*a+s*j*D*a-d*g*D*a-e*j*h*a+d*f*h*a},inverse:function(a, +d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=a[3],f=a[4],D=a[5],E=a[6],s=a[7],g=a[8],h=a[9],k=a[10],m=a[11],r=a[12],l=a[13],A=a[14],q=a[15],v=j*D-b*f,J=j*E-c*f,y=j*s-e*f,z=b*E-c*D,t=b*s-e*D,u=c*s-e*E,p=g*l-h*r,w=g*A-k*r,x=g*q-m*r,B=h*A-k*l,C=h*q-m*l,F=k*q-m*A,G=v*F-J*C+y*B+z*x-t*w+u*p;if(!G)return null;G=1/G;d[0]=(D*F-E*C+s*B)*G;d[1]=(-b*F+c*C-e*B)*G;d[2]=(l*u-A*t+q*z)*G;d[3]=(-h*u+k*t-m*z)*G;d[4]=(-f*F+E*x-s*w)*G;d[5]=(j*F-c*x+e*w)*G;d[6]=(-r*u+A*y-q*J)*G;d[7]=(g*u-k*y+m*J)*G;d[8]=(f*C-D*x+s*p)*G;d[9]= +(-j*C+b*x-e*p)*G;d[10]=(r*t-l*y+q*v)*G;d[11]=(-g*t+h*y-m*v)*G;d[12]=(-f*B+D*w-E*p)*G;d[13]=(j*B-b*w+c*p)*G;d[14]=(-r*z+l*J-A*v)*G;d[15]=(g*z-h*J+k*v)*G;return d},toRotationMat:function(a,d){d||(d=t.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d},toMat3:function(a,d){d||(d=x.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[4];d[4]=a[5];d[5]=a[6];d[6]=a[8];d[7]=a[9];d[8]=a[10]; +return d},toInverseMat3:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[4],f=a[5],D=a[6],g=a[8],s=a[9],h=a[10],k=h*f-D*s,m=-h*e+D*g,l=s*e-f*g,r=j*k+b*m+c*l;if(!r)return null;r=1/r;d||(d=x.create());d[0]=k*r;d[1]=(-h*b+c*s)*r;d[2]=(D*b-c*f)*r;d[3]=m*r;d[4]=(h*j-c*g)*r;d[5]=(-D*j+c*e)*r;d[6]=l*r;d[7]=(-s*j+b*g)*r;d[8]=(f*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],s=a[6],k=a[7],m=a[8],l=a[9],q=a[10],r=a[11],t=a[12],A=a[13],u=a[14];a=a[15];var v=d[0], +p=d[1],y=d[2],z=d[3];j[0]=v*b+p*g+y*m+z*t;j[1]=v*c+p*h+y*l+z*A;j[2]=v*e+p*s+y*q+z*u;j[3]=v*f+p*k+y*r+z*a;v=d[4];p=d[5];y=d[6];z=d[7];j[4]=v*b+p*g+y*m+z*t;j[5]=v*c+p*h+y*l+z*A;j[6]=v*e+p*s+y*q+z*u;j[7]=v*f+p*k+y*r+z*a;v=d[8];p=d[9];y=d[10];z=d[11];j[8]=v*b+p*g+y*m+z*t;j[9]=v*c+p*h+y*l+z*A;j[10]=v*e+p*s+y*q+z*u;j[11]=v*f+p*k+y*r+z*a;v=d[12];p=d[13];y=d[14];z=d[15];j[12]=v*b+p*g+y*m+z*t;j[13]=v*c+p*h+y*l+z*A;j[14]=v*e+p*s+y*q+z*u;j[15]=v*f+p*k+y*r+z*a;return j},multiplyVec3:function(a,d,b){b||(b=d); +var c=d[0],e=d[1];d=d[2];b[0]=a[0]*c+a[4]*e+a[8]*d+a[12];b[1]=a[1]*c+a[5]*e+a[9]*d+a[13];b[2]=a[2]*c+a[6]*e+a[10]*d+a[14];return b},multiplyVec4:function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=d[3];b[0]=a[0]*c+a[4]*e+a[8]*f+a[12]*d;b[1]=a[1]*c+a[5]*e+a[9]*f+a[13]*d;b[2]=a[2]*c+a[6]*e+a[10]*f+a[14]*d;b[3]=a[3]*c+a[7]*e+a[11]*f+a[15]*d;return b},translate:function(a,d,b){var c=d[0],e=d[1];d=d[2];var f,n,g,h,s,k,m,l,p,r,q,t;if(!b||a===b)return a[12]=a[0]*c+a[4]*e+a[8]*d+a[12],a[13]=a[1]*c+a[5]*e+ +a[9]*d+a[13],a[14]=a[2]*c+a[6]*e+a[10]*d+a[14],a[15]=a[3]*c+a[7]*e+a[11]*d+a[15],a;f=a[0];n=a[1];g=a[2];h=a[3];s=a[4];k=a[5];m=a[6];l=a[7];p=a[8];r=a[9];q=a[10];t=a[11];b[0]=f;b[1]=n;b[2]=g;b[3]=h;b[4]=s;b[5]=k;b[6]=m;b[7]=l;b[8]=p;b[9]=r;b[10]=q;b[11]=t;b[12]=f*c+s*e+p*d+a[12];b[13]=n*c+k*e+r*d+a[13];b[14]=g*c+m*e+q*d+a[14];b[15]=h*c+l*e+t*d+a[15];return b},scale:function(a,d,b){var c=d[0],e=d[1];d=d[2];if(!b||a===b)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=d,a[9]*= +d,a[10]*=d,a[11]*=d,a;b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[7]=a[7]*e;b[8]=a[8]*d;b[9]=a[9]*d;b[10]=a[10]*d;b[11]=a[11]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},rotate:function(a,d,b,c){var e=b[0],f=b[1];b=b[2];var n=Math.sqrt(e*e+f*f+b*b),g,h,k,m,l,p,q,r,t,u,w,v,x,y,z,B,C,F,H,K;if(!n)return null;1!==n&&(n=1/n,e*=n,f*=n,b*=n);g=Math.sin(d);h=Math.cos(d);k=1-h;d=a[0];n=a[1];m=a[2];l=a[3];p=a[4];q=a[5];r=a[6];t=a[7];u=a[8];w=a[9];v= +a[10];x=a[11];y=e*e*k+h;z=f*e*k+b*g;B=b*e*k-f*g;C=e*f*k-b*g;F=f*f*k+h;H=b*f*k+e*g;K=e*b*k+f*g;e=f*b*k-e*g;f=b*b*k+h;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=d*y+p*z+u*B;c[1]=n*y+q*z+w*B;c[2]=m*y+r*z+v*B;c[3]=l*y+t*z+x*B;c[4]=d*C+p*F+u*H;c[5]=n*C+q*F+w*H;c[6]=m*C+r*F+v*H;c[7]=l*C+t*F+x*H;c[8]=d*K+p*e+u*f;c[9]=n*K+q*e+w*f;c[10]=m*K+r*e+v*f;c[11]=l*K+t*e+x*f;return c},rotateX:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[4],f=a[5],n=a[6],g=a[7],h=a[8],k=a[9],m=a[10], +l=a[11];b?a!==b&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[4]=e*d+h*c;b[5]=f*d+k*c;b[6]=n*d+m*c;b[7]=g*d+l*c;b[8]=e*-c+h*d;b[9]=f*-c+k*d;b[10]=n*-c+m*d;b[11]=g*-c+l*d;return b},rotateY:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[8],k=a[9],m=a[10],l=a[11];b?a!==b&&(b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*-c;b[1]=f*d+k*-c;b[2]=n*d+m*-c;b[3]=g* +d+l*-c;b[8]=e*c+h*d;b[9]=f*c+k*d;b[10]=n*c+m*d;b[11]=g*c+l*d;return b},rotateZ:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[4],k=a[5],m=a[6],l=a[7];b?a!==b&&(b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*c;b[1]=f*d+k*c;b[2]=n*d+m*c;b[3]=g*d+l*c;b[4]=e*-c+h*d;b[5]=f*-c+k*d;b[6]=n*-c+m*d;b[7]=g*-c+l*d;return b},frustum:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2*e/g;n[1]=0; +n[2]=0;n[3]=0;n[4]=0;n[5]=2*e/h;n[6]=0;n[7]=0;n[8]=(d+a)/g;n[9]=(c+b)/h;n[10]=-(f+e)/k;n[11]=-1;n[12]=0;n[13]=0;n[14]=-(2*f*e)/k;n[15]=0;return n},perspective:function(a,d,b,c,e){a=b*Math.tan(a*Math.PI/360);d*=a;return t.frustum(-d,d,-a,a,b,c,e)},ortho:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2/g;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=2/h;n[6]=0;n[7]=0;n[8]=0;n[9]=0;n[10]=-2/k;n[11]=0;n[12]=-(a+d)/g;n[13]=-(c+b)/h;n[14]=-(f+e)/k;n[15]=1;return n},lookAt:function(a,d,b,c){c|| +(c=t.create());var e,f,n,g,h,k,m,l,p=a[0],q=a[1];a=a[2];n=b[0];g=b[1];f=b[2];m=d[0];b=d[1];e=d[2];if(p===m&&q===b&&a===e)return t.identity(c);d=p-m;b=q-b;m=a-e;l=1/Math.sqrt(d*d+b*b+m*m);d*=l;b*=l;m*=l;e=g*m-f*b;f=f*d-n*m;n=n*b-g*d;(l=Math.sqrt(e*e+f*f+n*n))?(l=1/l,e*=l,f*=l,n*=l):n=f=e=0;g=b*n-m*f;h=m*e-d*n;k=d*f-b*e;(l=Math.sqrt(g*g+h*h+k*k))?(l=1/l,g*=l,h*=l,k*=l):k=h=g=0;c[0]=e;c[1]=g;c[2]=d;c[3]=0;c[4]=f;c[5]=h;c[6]=b;c[7]=0;c[8]=n;c[9]=k;c[10]=m;c[11]=0;c[12]=-(e*p+f*q+n*a);c[13]=-(g*p+h*q+ +k*a);c[14]=-(d*p+b*q+m*a);c[15]=1;return c},fromRotationTranslation:function(a,d,b){b||(b=t.create());var c=a[0],e=a[1],f=a[2],n=a[3],g=c+c,h=e+e,k=f+f;a=c*g;var l=c*h,c=c*k,m=e*h,e=e*k,f=f*k,g=n*g,h=n*h,n=n*k;b[0]=1-(m+f);b[1]=l+n;b[2]=c-h;b[3]=0;b[4]=l-n;b[5]=1-(a+f);b[6]=e+g;b[7]=0;b[8]=c+h;b[9]=e-g;b[10]=1-(a+m);b[11]=0;b[12]=d[0];b[13]=d[1];b[14]=d[2];b[15]=1;return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ +a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},m={create:function(a){var d=new k(4);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]):d[0]=d[1]=d[2]=d[3]=0;return d},createFrom:function(a,d,b,c){var e=new k(4);e[0]=a;e[1]=d;e[2]=b;e[3]=c;return e},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])},identity:function(a){a||(a=m.create()); +a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},H=m.identity();m.calculateW=function(a,d){var b=a[0],c=a[1],e=a[2];if(!d||a===d)return a[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e)),a;d[0]=b;d[1]=c;d[2]=e;d[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e));return d};m.dot=function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3]};m.inverse=function(a,d){var b=a[0],c=a[1],e=a[2],f=a[3],b=(b=b*b+c*c+e*e+f*f)?1/b:0;if(!d||a===d)return a[0]*=-b,a[1]*=-b,a[2]*=-b,a[3]*=b,a;d[0]=-a[0]*b;d[1]=-a[1]*b;d[2]=-a[2]*b;d[3]=a[3]*b; +return d};m.conjugate=function(a,d){if(!d||a===d)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=a[3];return d};m.length=function(a){var d=a[0],b=a[1],c=a[2];a=a[3];return Math.sqrt(d*d+b*b+c*c+a*a)};m.normalize=function(a,d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=Math.sqrt(b*b+c*c+e*e+f*f);if(0===g)return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d;g=1/g;d[0]=b*g;d[1]=c*g;d[2]=e*g;d[3]=f*g;return d};m.add=function(a,d,b){if(!b||a===b)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a[3]+= +d[3],a;b[0]=a[0]+d[0];b[1]=a[1]+d[1];b[2]=a[2]+d[2];b[3]=a[3]+d[3];return b};m.multiply=function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2];a=a[3];var g=d[0],h=d[1],k=d[2];d=d[3];b[0]=c*d+a*g+e*k-f*h;b[1]=e*d+a*h+f*g-c*k;b[2]=f*d+a*k+c*h-e*g;b[3]=a*d-c*g-e*h-f*k;return b};m.multiplyVec3=function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=a[0];var g=a[1],h=a[2];a=a[3];var k=a*c+g*f-h*e,l=a*e+h*c-d*f,m=a*f+d*e-g*c,c=-d*c-g*e-h*f;b[0]=k*a+c*-d+l*-h-m*-g;b[1]=l*a+c*-g+m*-d-k*-h;b[2]=m*a+c*-h+k*-g-l*-d; +return b};m.scale=function(a,d,b){if(!b||a===b)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a;b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[3]=a[3]*d;return b};m.toMat3=function(a,d){d||(d=x.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b*k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=m-f;d[4]=1-(l+e);d[5]=c+g;d[6]=b+h;d[7]=c-g;d[8]=1-(l+p);return d};m.toMat4=function(a,d){d||(d=t.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b* +k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=0;d[4]=m-f;d[5]=1-(l+e);d[6]=c+g;d[7]=0;d[8]=b+h;d[9]=c-g;d[10]=1-(l+p);d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d};m.slerp=function(a,d,b,c){c||(c=a);var e=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3],f,g;if(1<=Math.abs(e))return c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]),c;f=Math.acos(e);g=Math.sqrt(1-e*e);if(0.0010>Math.abs(g))return c[0]=0.5*a[0]+0.5*d[0],c[1]=0.5*a[1]+0.5*d[1],c[2]=0.5*a[2]+0.5*d[2],c[3]=0.5*a[3]+ +0.5*d[3],c;e=Math.sin((1-b)*f)/g;b=Math.sin(b*f)/g;c[0]=a[0]*e+d[0]*b;c[1]=a[1]*e+d[1]*b;c[2]=a[2]*e+d[2]*b;c[3]=a[3]*e+d[3]*b;return c};m.fromRotationMatrix=function(a,d){d||(d=m.create());var b=a[0]+a[4]+a[8],c;if(0a[0]&&(b=1);a[8]>a[3*b+b]&&(b=2);var e=c[b],f=c[e];c=Math.sqrt(a[3*b+b]-a[3*e+e]-a[3*f+f]+1);d[b]=0.5*c;c= +0.5/c;d[3]=(a[3*f+e]-a[3*e+f])*c;d[e]=(a[3*e+b]+a[3*b+e])*c;d[f]=(a[3*f+b]+a[3*b+f])*c}return d};x.toQuat4=m.fromRotationMatrix;var B=x.create();m.fromAxes=function(a,d,b,c){B[0]=d[0];B[3]=d[1];B[6]=d[2];B[1]=b[0];B[4]=b[1];B[7]=b[2];B[2]=a[0];B[5]=a[1];B[8]=a[2];return m.fromRotationMatrix(B,c)};m.identity=function(a){a||(a=m.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};m.fromAngleAxis=function(a,d,b){b||(b=m.create());a*=0.5;var c=Math.sin(a);b[3]=Math.cos(a);b[0]=c*d[0];b[1]=c*d[1];b[2]=c*d[2]; +return b};m.toAngleAxis=function(a,d){d||(d=a);var b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); +b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 +Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],e=a[1],f=a[2],g=a[3],h=c*g-f*e;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-e*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, +b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];c[0]=e*b[0]+f*b[2];c[1]=e*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=e*b+f*h;c[1]=e*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var e=b[0];b=b[1];c[0]=e*a[0]+b*a[1];c[1]=e*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var e=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=e*b;c[2]=f*h;c[3]= +g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, +b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| +(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= +f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; +PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; +PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l>1);var b=m[0];return b*(1.5-0.5*a*b*b)}}else g.invsqrt=function(a){return 1/Math.sqrt(a)}; -var l=null;f();var j={create:function(a){var b=new l(3);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0;return b},createFrom:function(a,b,e){var c=new l(3);c[0]=a;c[1]=b;c[2]=e;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])},add:function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];return e},subtract:function(a, -b,e){if(!e||a===e)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];return e},multiply:function(a,b,e){if(!e||a===e)return a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a;e[0]=a[0]*b[0];e[1]=a[1]*b[1];e[2]=a[2]*b[2];return e},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;return e},normalize:function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=Math.sqrt(e* -e+c*c+d*d);if(!k)return b[0]=0,b[1]=0,b[2]=0,b;if(1===k)return b[0]=e,b[1]=c,b[2]=d,b;k=1/k;b[0]=e*k;b[1]=c*k;b[2]=d*k;return b},cross:function(a,b,e){e||(e=a);var c=a[0],d=a[1];a=a[2];var k=b[0],h=b[1];b=b[2];e[0]=d*b-a*h;e[1]=a*k-c*b;e[2]=c*h-d*k;return e},length:function(a){var b=a[0],e=a[1];a=a[2];return Math.sqrt(b*b+e*e+a*a)},squaredLength:function(a){var b=a[0],e=a[1];a=a[2];return b*b+e*e+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,b,e){e||(e=a);var c= -a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];b=Math.sqrt(c*c+d*d+a*a);if(!b)return e[0]=0,e[1]=0,e[2]=0,e;b=1/b;e[0]=c*b;e[1]=d*b;e[2]=a*b;return e},lerp:function(a,b,e,c){c||(c=a);c[0]=a[0]+e*(b[0]-a[0]);c[1]=a[1]+e*(b[1]-a[1]);c[2]=a[2]+e*(b[2]-a[2]);return c},dist:function(a,b){var e=b[0]-a[0],c=b[1]-a[1],d=b[2]-a[2];return Math.sqrt(e*e+c*c+d*d)}},x=null,n=new l(4);j.unproject=function(a,b,e,c,d){d||(d=a);x||(x=y.create());var k=x;n[0]=2*(a[0]-c[0])/c[2]-1;n[1]=2*(a[1]-c[1])/c[3]-1;n[2]=2*a[2]-1;n[3]=1; -y.multiply(e,b,k);if(!y.inverse(k))return null;y.multiplyVec4(k,n);if(0===n[3])return null;d[0]=n[0]/n[3];d[1]=n[1]/n[3];d[2]=n[2]/n[3];return d};var z=j.createFrom(1,0,0),A=j.createFrom(0,1,0),H=j.createFrom(0,0,1),C=j.create();j.rotationTo=function(a,b,e){e||(e=s.create());var c=j.dot(a,b);if(1<=c)s.set(O,e);else if(-0.999999>c)j.cross(z,a,C),1E-6>j.length(C)&&j.cross(A,a,C),1E-6>j.length(C)&&j.cross(H,a,C),j.normalize(C),s.fromAngleAxis(Math.PI,C,e);else{var c=Math.sqrt(2*(1+c)),d=1/c;j.cross(a, -b,C);e[0]=C[0]*d;e[1]=C[1]*d;e[2]=C[2]*d;e[3]=0.5*c;s.normalize(e)}1e[3]&&(e[3]=-1);return e};j.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var F={create:function(a){var b=new l(9);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0;return b},createFrom:function(a,b,e,c,d,k,h,E,K){var q=new l(9);q[0]=a;q[1]=b;q[2]=e;q[3]=c;q[4]=d;q[5]=k;q[6]=h;q[7]=E;q[8]=K;return q},determinant:function(a){var b= -a[3],e=a[4],c=a[5],d=a[6],k=a[7],h=a[8];return a[0]*(h*e-c*k)+a[1]*(-h*b+c*d)+a[2]*(k*b-e*d)},inverse:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],E=a[5],K=a[6],q=a[7],f=a[8],g=f*h-E*q,j=-f*k+E*K,J=q*k-h*K,r=e*g+c*j+d*J;if(!r)return null;r=1/r;b||(b=F.create());b[0]=g*r;b[1]=(-f*c+d*q)*r;b[2]=(E*c-d*h)*r;b[3]=j*r;b[4]=(f*e-d*K)*r;b[5]=(-E*e+d*k)*r;b[6]=J*r;b[7]=(-q*e+c*K)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],E=a[4],f=a[5],q=a[6],g= -a[7];a=a[8];var u=b[0],j=b[1],J=b[2],r=b[3],l=b[4],t=b[5],m=b[6],p=b[7];b=b[8];e[0]=u*c+j*h+J*q;e[1]=u*d+j*E+J*g;e[2]=u*k+j*f+J*a;e[3]=r*c+l*h+t*q;e[4]=r*d+l*E+t*g;e[5]=r*k+l*f+t*a;e[6]=m*c+p*h+b*q;e[7]=m*d+p*E+b*g;e[8]=m*k+p*f+b*a;return e},multiplyVec2:function(a,b,e){e||(e=b);var c=b[0];b=b[1];e[0]=c*a[0]+b*a[3]+a[6];e[1]=c*a[1]+b*a[4]+a[7];return e},multiplyVec3:function(a,b,e){e||(e=b);var c=b[0],d=b[1];b=b[2];e[0]=c*a[0]+d*a[3]+b*a[6];e[1]=c*a[1]+d*a[4]+b*a[7];e[2]=c*a[2]+d*a[5]+b*a[8];return e}, -set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])},identity:function(a){a||(a=F.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, -b){if(!b||a===b){var e=a[1],c=a[2],d=a[5];a[1]=a[3];a[2]=a[6];a[3]=e;a[5]=a[7];a[6]=c;a[7]=d;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]=a[8];return b},toMat4:function(a,b){b||(b=y.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ -a[8]+"]"}},y={create:function(a){var b=new l(16);a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]);return b},createFrom:function(a,b,e,c,d,k,h,E,f,q,g,u,j,J,r,m){var t=new l(16);t[0]=a;t[1]=b;t[2]=e;t[3]=c;t[4]=d;t[5]=k;t[6]=h;t[7]=E;t[8]=f;t[9]=q;t[10]=g;t[11]=u;t[12]=j;t[13]=J;t[14]=r;t[15]=m;return t},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4]; -b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])&&1E-6>Math.abs(a[9]-b[9])&&1E-6>Math.abs(a[10]-b[10])&&1E-6>Math.abs(a[11]-b[11])&&1E-6>Math.abs(a[12]- -b[12])&&1E-6>Math.abs(a[13]-b[13])&&1E-6>Math.abs(a[14]-b[14])&&1E-6>Math.abs(a[15]-b[15])},identity:function(a){a||(a=y.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){var e=a[1],c=a[2],d=a[3],k=a[6],h=a[7],E=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=e;a[6]=a[9];a[7]=a[13];a[8]=c;a[9]=k;a[11]=a[14];a[12]=d;a[13]=h;a[14]=E;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12]; -b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b=a[0],e=a[1],c=a[2],d=a[3],k=a[4],h=a[5],E=a[6],f=a[7],g=a[8],I=a[9],u=a[10],j=a[11],l=a[12],r=a[13],m=a[14];a=a[15];return l*I*E*d-g*r*E*d-l*h*u*d+k*r*u*d+g*h*m*d-k*I*m*d-l*I*c*f+g*r*c*f+l*e*u*f-b*r*u*f-g*e*m*f+b*I*m*f+l*h*c*j-k*r*c*j-l*e*E*j+b*r*E*j+k*e*m*j-b*h*m*j-g*h*c*a+k*I*c*a+g*e*E*a-b*I*E*a-k*e*u*a+b*h*u*a},inverse:function(a, -b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],f=a[5],g=a[6],q=a[7],I=a[8],u=a[9],j=a[10],l=a[11],r=a[12],m=a[13],t=a[14],p=a[15],s=e*f-c*h,n=e*g-d*h,v=e*q-k*h,w=c*g-d*f,x=c*q-k*f,y=d*q-k*g,z=I*m-u*r,A=I*t-j*r,C=I*p-l*r,D=u*t-j*m,F=u*p-l*m,H=j*p-l*t,G=s*H-n*F+v*D+w*C-x*A+y*z;if(!G)return null;G=1/G;b[0]=(f*H-g*F+q*D)*G;b[1]=(-c*H+d*F-k*D)*G;b[2]=(m*y-t*x+p*w)*G;b[3]=(-u*y+j*x-l*w)*G;b[4]=(-h*H+g*C-q*A)*G;b[5]=(e*H-d*C+k*A)*G;b[6]=(-r*y+t*v-p*n)*G;b[7]=(I*y-j*v+l*n)*G;b[8]=(h*F-f*C+q*z)*G;b[9]= -(-e*F+c*C-k*z)*G;b[10]=(r*x-m*v+p*s)*G;b[11]=(-I*x+u*v-l*s)*G;b[12]=(-h*D+f*A-g*z)*G;b[13]=(e*D-c*A+d*z)*G;b[14]=(-r*w+m*n-t*s)*G;b[15]=(I*w-u*n+j*s)*G;return b},toRotationMat:function(a,b){b||(b=y.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=F.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10]; -return b},toInverseMat3:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[4],h=a[5],f=a[6],g=a[8],q=a[9],j=a[10],u=j*h-f*q,l=-j*k+f*g,m=q*k-h*g,r=e*u+c*l+d*m;if(!r)return null;r=1/r;b||(b=F.create());b[0]=u*r;b[1]=(-j*c+d*q)*r;b[2]=(f*c-d*h)*r;b[3]=l*r;b[4]=(j*e-d*g)*r;b[5]=(-f*e+d*k)*r;b[6]=m*r;b[7]=(-q*e+c*g)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],f=a[4],g=a[5],q=a[6],j=a[7],u=a[8],l=a[9],m=a[10],r=a[11],p=a[12],t=a[13],s=a[14];a=a[15];var n=b[0], -B=b[1],v=b[2],w=b[3];e[0]=n*c+B*f+v*u+w*p;e[1]=n*d+B*g+v*l+w*t;e[2]=n*k+B*q+v*m+w*s;e[3]=n*h+B*j+v*r+w*a;n=b[4];B=b[5];v=b[6];w=b[7];e[4]=n*c+B*f+v*u+w*p;e[5]=n*d+B*g+v*l+w*t;e[6]=n*k+B*q+v*m+w*s;e[7]=n*h+B*j+v*r+w*a;n=b[8];B=b[9];v=b[10];w=b[11];e[8]=n*c+B*f+v*u+w*p;e[9]=n*d+B*g+v*l+w*t;e[10]=n*k+B*q+v*m+w*s;e[11]=n*h+B*j+v*r+w*a;n=b[12];B=b[13];v=b[14];w=b[15];e[12]=n*c+B*f+v*u+w*p;e[13]=n*d+B*g+v*l+w*t;e[14]=n*k+B*q+v*m+w*s;e[15]=n*h+B*j+v*r+w*a;return e},multiplyVec3:function(a,b,e){e||(e=b); -var c=b[0],d=b[1];b=b[2];e[0]=a[0]*c+a[4]*d+a[8]*b+a[12];e[1]=a[1]*c+a[5]*d+a[9]*b+a[13];e[2]=a[2]*c+a[6]*d+a[10]*b+a[14];return e},multiplyVec4:function(a,b,e){e||(e=b);var c=b[0],d=b[1],k=b[2];b=b[3];e[0]=a[0]*c+a[4]*d+a[8]*k+a[12]*b;e[1]=a[1]*c+a[5]*d+a[9]*k+a[13]*b;e[2]=a[2]*c+a[6]*d+a[10]*k+a[14]*b;e[3]=a[3]*c+a[7]*d+a[11]*k+a[15]*b;return e},translate:function(a,b,e){var c=b[0],d=b[1];b=b[2];var k,h,f,g,q,j,u,l,m,n,p,s;if(!e||a===e)return a[12]=a[0]*c+a[4]*d+a[8]*b+a[12],a[13]=a[1]*c+a[5]*d+ -a[9]*b+a[13],a[14]=a[2]*c+a[6]*d+a[10]*b+a[14],a[15]=a[3]*c+a[7]*d+a[11]*b+a[15],a;k=a[0];h=a[1];f=a[2];g=a[3];q=a[4];j=a[5];u=a[6];l=a[7];m=a[8];n=a[9];p=a[10];s=a[11];e[0]=k;e[1]=h;e[2]=f;e[3]=g;e[4]=q;e[5]=j;e[6]=u;e[7]=l;e[8]=m;e[9]=n;e[10]=p;e[11]=s;e[12]=k*c+q*d+m*b+a[12];e[13]=h*c+j*d+n*b+a[13];e[14]=f*c+u*d+p*b+a[14];e[15]=g*c+l*d+s*b+a[15];return e},scale:function(a,b,e){var c=b[0],d=b[1];b=b[2];if(!e||a===e)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=d,a[5]*=d,a[6]*=d,a[7]*=d,a[8]*=b,a[9]*= -b,a[10]*=b,a[11]*=b,a;e[0]=a[0]*c;e[1]=a[1]*c;e[2]=a[2]*c;e[3]=a[3]*c;e[4]=a[4]*d;e[5]=a[5]*d;e[6]=a[6]*d;e[7]=a[7]*d;e[8]=a[8]*b;e[9]=a[9]*b;e[10]=a[10]*b;e[11]=a[11]*b;e[12]=a[12];e[13]=a[13];e[14]=a[14];e[15]=a[15];return e},rotate:function(a,b,e,c){var d=e[0],k=e[1];e=e[2];var h=Math.sqrt(d*d+k*k+e*e),f,g,q,j,l,m,n,r,p,s,x,y,B,v,w,z,A,C,D,F;if(!h)return null;1!==h&&(h=1/h,d*=h,k*=h,e*=h);f=Math.sin(b);g=Math.cos(b);q=1-g;b=a[0];h=a[1];j=a[2];l=a[3];m=a[4];n=a[5];r=a[6];p=a[7];s=a[8];x=a[9];y= -a[10];B=a[11];v=d*d*q+g;w=k*d*q+e*f;z=e*d*q-k*f;A=d*k*q-e*f;C=k*k*q+g;D=e*k*q+d*f;F=d*e*q+k*f;d=k*e*q-d*f;k=e*e*q+g;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=b*v+m*w+s*z;c[1]=h*v+n*w+x*z;c[2]=j*v+r*w+y*z;c[3]=l*v+p*w+B*z;c[4]=b*A+m*C+s*D;c[5]=h*A+n*C+x*D;c[6]=j*A+r*C+y*D;c[7]=l*A+p*C+B*D;c[8]=b*F+m*d+s*k;c[9]=h*F+n*d+x*k;c[10]=j*F+r*d+y*k;c[11]=l*F+p*d+B*k;return c},rotateX:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[4],k=a[5],h=a[6],f=a[7],g=a[8],q=a[9],j=a[10], -l=a[11];e?a!==e&&(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[4]=d*b+g*c;e[5]=k*b+q*c;e[6]=h*b+j*c;e[7]=f*b+l*c;e[8]=d*-c+g*b;e[9]=k*-c+q*b;e[10]=h*-c+j*b;e[11]=f*-c+l*b;return e},rotateY:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[8],j=a[9],l=a[10],m=a[11];e?a!==e&&(e[4]=a[4],e[5]=a[5],e[6]=a[6],e[7]=a[7],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*-c;e[1]=k*b+j*-c;e[2]=h*b+l*-c;e[3]=f* -b+m*-c;e[8]=d*c+g*b;e[9]=k*c+j*b;e[10]=h*c+l*b;e[11]=f*c+m*b;return e},rotateZ:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[4],j=a[5],l=a[6],m=a[7];e?a!==e&&(e[8]=a[8],e[9]=a[9],e[10]=a[10],e[11]=a[11],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*c;e[1]=k*b+j*c;e[2]=h*b+l*c;e[3]=f*b+m*c;e[4]=d*-c+g*b;e[5]=k*-c+j*b;e[6]=h*-c+l*b;e[7]=f*-c+m*b;return e},frustum:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2*d/f;h[1]=0; -h[2]=0;h[3]=0;h[4]=0;h[5]=2*d/g;h[6]=0;h[7]=0;h[8]=(b+a)/f;h[9]=(c+e)/g;h[10]=-(k+d)/j;h[11]=-1;h[12]=0;h[13]=0;h[14]=-(2*k*d)/j;h[15]=0;return h},perspective:function(a,b,e,c,d){a=e*Math.tan(a*Math.PI/360);b*=a;return y.frustum(-b,b,-a,a,e,c,d)},ortho:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2/f;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/g;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/j;h[11]=0;h[12]=-(a+b)/f;h[13]=-(c+e)/g;h[14]=-(k+d)/j;h[15]=1;return h},lookAt:function(a,b,e,c){c|| -(c=y.create());var d,k,h,f,g,j,l,m,n=a[0],p=a[1];a=a[2];h=e[0];f=e[1];k=e[2];l=b[0];e=b[1];d=b[2];if(n===l&&p===e&&a===d)return y.identity(c);b=n-l;e=p-e;l=a-d;m=1/Math.sqrt(b*b+e*e+l*l);b*=m;e*=m;l*=m;d=f*l-k*e;k=k*b-h*l;h=h*e-f*b;(m=Math.sqrt(d*d+k*k+h*h))?(m=1/m,d*=m,k*=m,h*=m):h=k=d=0;f=e*h-l*k;g=l*d-b*h;j=b*k-e*d;(m=Math.sqrt(f*f+g*g+j*j))?(m=1/m,f*=m,g*=m,j*=m):j=g=f=0;c[0]=d;c[1]=f;c[2]=b;c[3]=0;c[4]=k;c[5]=g;c[6]=e;c[7]=0;c[8]=h;c[9]=j;c[10]=l;c[11]=0;c[12]=-(d*n+k*p+h*a);c[13]=-(f*n+g*p+ -j*a);c[14]=-(b*n+e*p+l*a);c[15]=1;return c},fromRotationTranslation:function(a,b,e){e||(e=y.create());var c=a[0],d=a[1],k=a[2],h=a[3],f=c+c,g=d+d,j=k+k;a=c*f;var l=c*g,c=c*j,m=d*g,d=d*j,k=k*j,f=h*f,g=h*g,h=h*j;e[0]=1-(m+k);e[1]=l+h;e[2]=c-g;e[3]=0;e[4]=l-h;e[5]=1-(a+k);e[6]=d+f;e[7]=0;e[8]=c+g;e[9]=d-f;e[10]=1-(a+m);e[11]=0;e[12]=b[0];e[13]=b[1];e[14]=b[2];e[15]=1;return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ -a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},s={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,e,c){var d=new l(4);d[0]=a;d[1]=b;d[2]=e;d[3]=c;return d},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=s.create()); -a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},O=s.identity();s.calculateW=function(a,b){var e=a[0],c=a[1],d=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d)),a;b[0]=e;b[1]=c;b[2]=d;b[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d));return b};s.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};s.inverse=function(a,b){var e=a[0],c=a[1],d=a[2],f=a[3],e=(e=e*e+c*c+d*d+f*f)?1/e:0;if(!b||a===b)return a[0]*=-e,a[1]*=-e,a[2]*=-e,a[3]*=e,a;b[0]=-a[0]*e;b[1]=-a[1]*e;b[2]=-a[2]*e;b[3]=a[3]*e; -return b};s.conjugate=function(a,b){if(!b||a===b)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};s.length=function(a){var b=a[0],e=a[1],c=a[2];a=a[3];return Math.sqrt(b*b+e*e+c*c+a*a)};s.normalize=function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],f=a[3],h=Math.sqrt(e*e+c*c+d*d+f*f);if(0===h)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;h=1/h;b[0]=e*h;b[1]=c*h;b[2]=d*h;b[3]=f*h;return b};s.add=function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+= -b[3],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];e[3]=a[3]+b[3];return e};s.multiply=function(a,b,e){e||(e=a);var c=a[0],d=a[1],f=a[2];a=a[3];var h=b[0],g=b[1],j=b[2];b=b[3];e[0]=c*b+a*h+d*j-f*g;e[1]=d*b+a*g+f*h-c*j;e[2]=f*b+a*j+c*g-d*h;e[3]=a*b-c*h-d*g-f*j;return e};s.multiplyVec3=function(a,b,e){e||(e=b);var c=b[0],d=b[1],f=b[2];b=a[0];var h=a[1],g=a[2];a=a[3];var j=a*c+h*f-g*d,l=a*d+g*c-b*f,m=a*f+b*d-h*c,c=-b*c-h*d-g*f;e[0]=j*a+c*-b+l*-g-m*-h;e[1]=l*a+c*-h+m*-b-j*-g;e[2]=m*a+c*-g+j*-h-l*-b; -return e};s.scale=function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a[3]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;e[3]=a[3]*b;return e};s.toMat3=function(a,b){b||(b=F.create());var e=a[0],c=a[1],d=a[2],f=a[3],h=e+e,g=c+c,j=d+d,l=e*h,m=e*g,e=e*j,n=c*g,c=c*j,d=d*j,h=f*h,g=f*g,f=f*j;b[0]=1-(n+d);b[1]=m+f;b[2]=e-g;b[3]=m-f;b[4]=1-(l+d);b[5]=c+h;b[6]=e+g;b[7]=c-h;b[8]=1-(l+n);return b};s.toMat4=function(a,b){b||(b=y.create());var e=a[0],c=a[1],d=a[2],f=a[3],g=e+e,j=c+c,l=d+d,m=e*g,n=e*j,e=e* -l,p=c*j,c=c*l,d=d*l,g=f*g,j=f*j,f=f*l;b[0]=1-(p+d);b[1]=n+f;b[2]=e-j;b[3]=0;b[4]=n-f;b[5]=1-(m+d);b[6]=c+g;b[7]=0;b[8]=e+j;b[9]=c-g;b[10]=1-(m+p);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};s.slerp=function(a,b,c,d){d||(d=a);var f=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],g,h;if(1<=Math.abs(f))return d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d;g=Math.acos(f);h=Math.sqrt(1-f*f);if(0.001>Math.abs(h))return d[0]=0.5*a[0]+0.5*b[0],d[1]=0.5*a[1]+0.5*b[1],d[2]=0.5*a[2]+0.5*b[2],d[3]=0.5*a[3]+ -0.5*b[3],d;f=Math.sin((1-c)*g)/h;c=Math.sin(c*g)/h;d[0]=a[0]*f+b[0]*c;d[1]=a[1]*f+b[1]*c;d[2]=a[2]*f+b[2]*c;d[3]=a[3]*f+b[3]*c;return d};s.fromRotationMatrix=function(a,b){b||(b=s.create());var c=a[0]+a[4]+a[8],d;if(0a[0]&&(c=1);a[8]>a[3*c+c]&&(c=2);var f=d[c],g=d[f];d=Math.sqrt(a[3*c+c]-a[3*f+f]-a[3*g+g]+1);b[c]=0.5*d;d= -0.5/d;b[3]=(a[3*g+f]-a[3*f+g])*d;b[f]=(a[3*f+c]+a[3*c+f])*d;b[g]=(a[3*g+c]+a[3*c+g])*d}return b};F.toQuat4=s.fromRotationMatrix;var D=F.create();s.fromAxes=function(a,b,c,d){D[0]=b[0];D[3]=b[1];D[6]=b[2];D[1]=c[0];D[4]=c[1];D[7]=c[2];D[2]=a[0];D[5]=a[1];D[8]=a[2];return s.fromRotationMatrix(D,d)};s.identity=function(a){a||(a=s.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};s.fromAngleAxis=function(a,b,c){c||(c=s.create());a*=0.5;var d=Math.sin(a);c[3]=Math.cos(a);c[0]=d*b[0];c[1]=d*b[1];c[2]=d*b[2]; -return c};s.toAngleAxis=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); -b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 -Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],f=a[2],g=a[3],h=c*g-f*d;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-d*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, -b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];c[0]=d*b[0]+f*b[2];c[1]=d*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=d*b+f*h;c[1]=d*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var d=b[0];b=b[1];c[0]=d*a[0]+b*a[1];c[1]=d*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var d=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=d*b;c[2]=f*h;c[3]= -g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,d){var f=new l(4);f[0]=a;f[1]=b;f[2]=c;f[3]=d;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, -b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| -(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)},squaredLength:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};c&&(c.glMatrixArrayType=l,c.MatrixArray=l,c.setMatrixArrayType=d,c.determineMatrixArrayType= -f,c.glMath=g,c.vec2=M,c.vec3=j,c.vec4=N,c.mat2=L,c.mat3=F,c.mat4=y,c.quat4=s);return{glMatrixArrayType:l,MatrixArray:l,setMatrixArrayType:d,determineMatrixArrayType:f,glMath:g,vec2:M,vec3:j,vec4:N,mat2:L,mat3:F,mat4:y,quat4:s}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * vColor;","}"]; -PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"]; -PIXI.CompileVertexShader=function(c,d){for(var f="",g=0;g>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/examples/bunny benchmark/index.html b/examples/bunny benchmark/index.html index 7c5521b..95972c4 100644 --- a/examples/bunny benchmark/index.html +++ b/examples/bunny benchmark/index.html @@ -9,9 +9,10 @@ +
    Click to add more bunnys! Let me know how many you get on screen here @doormat23
    - + diff --git a/examples/bunny benchmark/js/bunnyBenchMark.js b/examples/bunny benchmark/js/bunnyBenchMark.js index a3154eb..c3c8ec5 100644 --- a/examples/bunny benchmark/js/bunnyBenchMark.js +++ b/examples/bunny benchmark/js/bunnyBenchMark.js @@ -22,18 +22,13 @@ var count = 0; var container; +var detail; + function onReady() { - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() + detail = document.getElementById("pixi"); - if(webgl) - { - renderer = new PIXI.WebGLRenderer(); - } - else - { - renderer = new PIXI.CanvasRenderer(480, 320); - } + renderer = PIXI.autoDetectRenderer(); stage = new PIXI.Stage; @@ -46,7 +41,7 @@ stats.domElement.style.top = "0px"; requestAnimFrame(update); - wabbitTexture = new PIXI.Texture("wabbit.png") + wabbitTexture = new PIXI.Texture.fromImage("wabbit.png") counter = document.createElement("div"); counter.className = "counter"; @@ -55,7 +50,6 @@ count = startBunnyCount; counter.innerHTML = count + " BUNNIES"; - container = new PIXI.DisplayObjectContainer(); stage.addChild(container); @@ -114,7 +108,9 @@ minX = 0; maxY = height; minY = 0; - + + detail.style.left = width - 204 + "px"; + detail.style.top = height - 100 + "px"; renderer.resize(width, height); } @@ -126,17 +122,17 @@ { // add 10 at a time :) - for (var i = 0; i < 2; i++) + for (var i = 0; i < 10; i++) { - var bunny = new PIXI.Sprite(wabbitTexture, {x:0, y:0, width:26, height:37}); + var bunny = new PIXI.Sprite(wabbitTexture); bunny.speedX = Math.random() * 10; bunny.speedY = (Math.random() * 10) - 5; bunny.anchor.x = 0.5; bunny.anchor.y = 1; - bunny.alpha = 0.3 + Math.random() * 0.7; + //bunny.alpha = 0.3 + Math.random() * 0.7; bunnys.push(bunny); - bunny.rotation = Math.random() - 0.5; + //bunny.rotation = Math.random() - 0.5; container.addChild(bunny); count++; diff --git a/examples/bunny benchmark/js/pixi.js b/examples/bunny benchmark/js/pixi.js new file mode 100644 index 0000000..65add09 --- /dev/null +++ b/examples/bunny benchmark/js/pixi.js @@ -0,0 +1,110 @@ +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, +d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* +j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= +a[0]-d[0],c=a[1]-d[1];a=a[2]-d[2];d=Math.sqrt(b*b+c*c+a*a);if(!d)return j[0]=0,j[1]=0,j[2]=0,j;d=1/d;j[0]=b*d;j[1]=c*d;j[2]=a*d;return j},lerp:function(a,d,j,b){b||(b=a);b[0]=a[0]+j*(d[0]-a[0]);b[1]=a[1]+j*(d[1]-a[1]);b[2]=a[2]+j*(d[2]-a[2]);return b},dist:function(a,d){var j=d[0]-a[0],b=d[1]-a[1],c=d[2]-a[2];return Math.sqrt(j*j+b*b+c*c)}},p=null,q=new k(4);l.unproject=function(a,d,j,b,c){c||(c=a);p||(p=t.create());var e=p;q[0]=2*(a[0]-b[0])/b[2]-1;q[1]=2*(a[1]-b[1])/b[3]-1;q[2]=2*a[2]-1;q[3]=1; +t.multiply(j,d,e);if(!t.inverse(e))return null;t.multiplyVec4(e,q);if(0===q[3])return null;c[0]=q[0]/q[3];c[1]=q[1]/q[3];c[2]=q[2]/q[3];return c};var C=l.createFrom(1,0,0),F=l.createFrom(0,1,0),u=l.createFrom(0,0,1),w=l.create();l.rotationTo=function(a,d,j){j||(j=m.create());var b=l.dot(a,d);if(1<=b)m.set(H,j);else if(-0.999999>b)l.cross(C,a,w),1E-6>l.length(w)&&l.cross(F,a,w),1E-6>l.length(w)&&l.cross(u,a,w),l.normalize(w),m.fromAngleAxis(Math.PI,w,j);else{var b=Math.sqrt(2*(1+b)),c=1/b;l.cross(a, +d,w);j[0]=w[0]*c;j[1]=w[1]*c;j[2]=w[2]*c;j[3]=0.5*b;m.normalize(j)}1j[3]&&(j[3]=-1);return j};l.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var x={create:function(a){var d=new k(9);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8]):d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=0;return d},createFrom:function(a,d,j,b,c,e,n,f,E){var s=new k(9);s[0]=a;s[1]=d;s[2]=j;s[3]=b;s[4]=c;s[5]=e;s[6]=n;s[7]=f;s[8]=E;return s},determinant:function(a){var d= +a[3],j=a[4],b=a[5],c=a[6],e=a[7],n=a[8];return a[0]*(n*j-b*e)+a[1]*(-n*d+b*c)+a[2]*(e*d-j*c)},inverse:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[3],n=a[4],f=a[5],E=a[6],s=a[7],I=a[8],g=I*n-f*s,h=-I*e+f*E,k=s*e-n*E,r=j*g+b*h+c*k;if(!r)return null;r=1/r;d||(d=x.create());d[0]=g*r;d[1]=(-I*b+c*s)*r;d[2]=(f*b-c*n)*r;d[3]=h*r;d[4]=(I*j-c*E)*r;d[5]=(-f*j+c*e)*r;d[6]=k*r;d[7]=(-s*j+b*E)*r;d[8]=(n*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],D=a[4],E=a[5],s=a[6],I= +a[7];a=a[8];var g=d[0],h=d[1],k=d[2],r=d[3],m=d[4],l=d[5],q=d[6],v=d[7];d=d[8];j[0]=g*b+h*f+k*s;j[1]=g*c+h*D+k*I;j[2]=g*e+h*E+k*a;j[3]=r*b+m*f+l*s;j[4]=r*c+m*D+l*I;j[5]=r*e+m*E+l*a;j[6]=q*b+v*f+d*s;j[7]=q*c+v*D+d*I;j[8]=q*e+v*E+d*a;return j},multiplyVec2:function(a,d,j){j||(j=d);var b=d[0];d=d[1];j[0]=b*a[0]+d*a[3]+a[6];j[1]=b*a[1]+d*a[4]+a[7];return j},multiplyVec3:function(a,d,j){j||(j=d);var b=d[0],c=d[1];d=d[2];j[0]=b*a[0]+c*a[3]+d*a[6];j[1]=b*a[1]+c*a[4]+d*a[7];j[2]=b*a[2]+c*a[5]+d*a[8];return j}, +set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])},identity:function(a){a||(a=x.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, +d){if(!d||a===d){var j=a[1],b=a[2],c=a[5];a[1]=a[3];a[2]=a[6];a[3]=j;a[5]=a[7];a[6]=b;a[7]=c;return a}d[0]=a[0];d[1]=a[3];d[2]=a[6];d[3]=a[1];d[4]=a[4];d[5]=a[7];d[6]=a[2];d[7]=a[5];d[8]=a[8];return d},toMat4:function(a,d){d||(d=t.create());d[15]=1;d[14]=0;d[13]=0;d[12]=0;d[11]=0;d[10]=a[8];d[9]=a[7];d[8]=a[6];d[7]=0;d[6]=a[5];d[5]=a[4];d[4]=a[3];d[3]=0;d[2]=a[2];d[1]=a[1];d[0]=a[0];return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ +a[8]+"]"}},t={create:function(a){var d=new k(16);a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8],d[9]=a[9],d[10]=a[10],d[11]=a[11],d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d},createFrom:function(a,d,j,b,c,e,f,D,E,s,g,h,m,l,r,q){var A=new k(16);A[0]=a;A[1]=d;A[2]=j;A[3]=b;A[4]=c;A[5]=e;A[6]=f;A[7]=D;A[8]=E;A[9]=s;A[10]=g;A[11]=h;A[12]=m;A[13]=l;A[14]=r;A[15]=q;return A},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4]; +d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=a[12];d[13]=a[13];d[14]=a[14];d[15]=a[15];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])&&1E-6>Math.abs(a[9]-d[9])&&1E-6>Math.abs(a[10]-d[10])&&1E-6>Math.abs(a[11]-d[11])&&1E-6>Math.abs(a[12]- +d[12])&&1E-6>Math.abs(a[13]-d[13])&&1E-6>Math.abs(a[14]-d[14])&&1E-6>Math.abs(a[15]-d[15])},identity:function(a){a||(a=t.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,d){if(!d||a===d){var j=a[1],b=a[2],c=a[3],e=a[6],f=a[7],D=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=j;a[6]=a[9];a[7]=a[13];a[8]=b;a[9]=e;a[11]=a[14];a[12]=c;a[13]=f;a[14]=D;return a}d[0]=a[0];d[1]=a[4];d[2]=a[8];d[3]=a[12]; +d[4]=a[1];d[5]=a[5];d[6]=a[9];d[7]=a[13];d[8]=a[2];d[9]=a[6];d[10]=a[10];d[11]=a[14];d[12]=a[3];d[13]=a[7];d[14]=a[11];d[15]=a[15];return d},determinant:function(a){var d=a[0],j=a[1],b=a[2],c=a[3],e=a[4],f=a[5],D=a[6],E=a[7],s=a[8],g=a[9],h=a[10],k=a[11],m=a[12],r=a[13],l=a[14];a=a[15];return m*g*D*c-s*r*D*c-m*f*h*c+e*r*h*c+s*f*l*c-e*g*l*c-m*g*b*E+s*r*b*E+m*j*h*E-d*r*h*E-s*j*l*E+d*g*l*E+m*f*b*k-e*r*b*k-m*j*D*k+d*r*D*k+e*j*l*k-d*f*l*k-s*f*b*a+e*g*b*a+s*j*D*a-d*g*D*a-e*j*h*a+d*f*h*a},inverse:function(a, +d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=a[3],f=a[4],D=a[5],E=a[6],s=a[7],g=a[8],h=a[9],k=a[10],m=a[11],r=a[12],l=a[13],A=a[14],q=a[15],v=j*D-b*f,J=j*E-c*f,y=j*s-e*f,z=b*E-c*D,t=b*s-e*D,u=c*s-e*E,p=g*l-h*r,w=g*A-k*r,x=g*q-m*r,B=h*A-k*l,C=h*q-m*l,F=k*q-m*A,G=v*F-J*C+y*B+z*x-t*w+u*p;if(!G)return null;G=1/G;d[0]=(D*F-E*C+s*B)*G;d[1]=(-b*F+c*C-e*B)*G;d[2]=(l*u-A*t+q*z)*G;d[3]=(-h*u+k*t-m*z)*G;d[4]=(-f*F+E*x-s*w)*G;d[5]=(j*F-c*x+e*w)*G;d[6]=(-r*u+A*y-q*J)*G;d[7]=(g*u-k*y+m*J)*G;d[8]=(f*C-D*x+s*p)*G;d[9]= +(-j*C+b*x-e*p)*G;d[10]=(r*t-l*y+q*v)*G;d[11]=(-g*t+h*y-m*v)*G;d[12]=(-f*B+D*w-E*p)*G;d[13]=(j*B-b*w+c*p)*G;d[14]=(-r*z+l*J-A*v)*G;d[15]=(g*z-h*J+k*v)*G;return d},toRotationMat:function(a,d){d||(d=t.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d},toMat3:function(a,d){d||(d=x.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[4];d[4]=a[5];d[5]=a[6];d[6]=a[8];d[7]=a[9];d[8]=a[10]; +return d},toInverseMat3:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[4],f=a[5],D=a[6],g=a[8],s=a[9],h=a[10],k=h*f-D*s,m=-h*e+D*g,l=s*e-f*g,r=j*k+b*m+c*l;if(!r)return null;r=1/r;d||(d=x.create());d[0]=k*r;d[1]=(-h*b+c*s)*r;d[2]=(D*b-c*f)*r;d[3]=m*r;d[4]=(h*j-c*g)*r;d[5]=(-D*j+c*e)*r;d[6]=l*r;d[7]=(-s*j+b*g)*r;d[8]=(f*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],s=a[6],k=a[7],m=a[8],l=a[9],q=a[10],r=a[11],t=a[12],A=a[13],u=a[14];a=a[15];var v=d[0], +p=d[1],y=d[2],z=d[3];j[0]=v*b+p*g+y*m+z*t;j[1]=v*c+p*h+y*l+z*A;j[2]=v*e+p*s+y*q+z*u;j[3]=v*f+p*k+y*r+z*a;v=d[4];p=d[5];y=d[6];z=d[7];j[4]=v*b+p*g+y*m+z*t;j[5]=v*c+p*h+y*l+z*A;j[6]=v*e+p*s+y*q+z*u;j[7]=v*f+p*k+y*r+z*a;v=d[8];p=d[9];y=d[10];z=d[11];j[8]=v*b+p*g+y*m+z*t;j[9]=v*c+p*h+y*l+z*A;j[10]=v*e+p*s+y*q+z*u;j[11]=v*f+p*k+y*r+z*a;v=d[12];p=d[13];y=d[14];z=d[15];j[12]=v*b+p*g+y*m+z*t;j[13]=v*c+p*h+y*l+z*A;j[14]=v*e+p*s+y*q+z*u;j[15]=v*f+p*k+y*r+z*a;return j},multiplyVec3:function(a,d,b){b||(b=d); +var c=d[0],e=d[1];d=d[2];b[0]=a[0]*c+a[4]*e+a[8]*d+a[12];b[1]=a[1]*c+a[5]*e+a[9]*d+a[13];b[2]=a[2]*c+a[6]*e+a[10]*d+a[14];return b},multiplyVec4:function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=d[3];b[0]=a[0]*c+a[4]*e+a[8]*f+a[12]*d;b[1]=a[1]*c+a[5]*e+a[9]*f+a[13]*d;b[2]=a[2]*c+a[6]*e+a[10]*f+a[14]*d;b[3]=a[3]*c+a[7]*e+a[11]*f+a[15]*d;return b},translate:function(a,d,b){var c=d[0],e=d[1];d=d[2];var f,n,g,h,s,k,m,l,p,r,q,t;if(!b||a===b)return a[12]=a[0]*c+a[4]*e+a[8]*d+a[12],a[13]=a[1]*c+a[5]*e+ +a[9]*d+a[13],a[14]=a[2]*c+a[6]*e+a[10]*d+a[14],a[15]=a[3]*c+a[7]*e+a[11]*d+a[15],a;f=a[0];n=a[1];g=a[2];h=a[3];s=a[4];k=a[5];m=a[6];l=a[7];p=a[8];r=a[9];q=a[10];t=a[11];b[0]=f;b[1]=n;b[2]=g;b[3]=h;b[4]=s;b[5]=k;b[6]=m;b[7]=l;b[8]=p;b[9]=r;b[10]=q;b[11]=t;b[12]=f*c+s*e+p*d+a[12];b[13]=n*c+k*e+r*d+a[13];b[14]=g*c+m*e+q*d+a[14];b[15]=h*c+l*e+t*d+a[15];return b},scale:function(a,d,b){var c=d[0],e=d[1];d=d[2];if(!b||a===b)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=d,a[9]*= +d,a[10]*=d,a[11]*=d,a;b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[7]=a[7]*e;b[8]=a[8]*d;b[9]=a[9]*d;b[10]=a[10]*d;b[11]=a[11]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},rotate:function(a,d,b,c){var e=b[0],f=b[1];b=b[2];var n=Math.sqrt(e*e+f*f+b*b),g,h,k,m,l,p,q,r,t,u,w,v,x,y,z,B,C,F,H,K;if(!n)return null;1!==n&&(n=1/n,e*=n,f*=n,b*=n);g=Math.sin(d);h=Math.cos(d);k=1-h;d=a[0];n=a[1];m=a[2];l=a[3];p=a[4];q=a[5];r=a[6];t=a[7];u=a[8];w=a[9];v= +a[10];x=a[11];y=e*e*k+h;z=f*e*k+b*g;B=b*e*k-f*g;C=e*f*k-b*g;F=f*f*k+h;H=b*f*k+e*g;K=e*b*k+f*g;e=f*b*k-e*g;f=b*b*k+h;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=d*y+p*z+u*B;c[1]=n*y+q*z+w*B;c[2]=m*y+r*z+v*B;c[3]=l*y+t*z+x*B;c[4]=d*C+p*F+u*H;c[5]=n*C+q*F+w*H;c[6]=m*C+r*F+v*H;c[7]=l*C+t*F+x*H;c[8]=d*K+p*e+u*f;c[9]=n*K+q*e+w*f;c[10]=m*K+r*e+v*f;c[11]=l*K+t*e+x*f;return c},rotateX:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[4],f=a[5],n=a[6],g=a[7],h=a[8],k=a[9],m=a[10], +l=a[11];b?a!==b&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[4]=e*d+h*c;b[5]=f*d+k*c;b[6]=n*d+m*c;b[7]=g*d+l*c;b[8]=e*-c+h*d;b[9]=f*-c+k*d;b[10]=n*-c+m*d;b[11]=g*-c+l*d;return b},rotateY:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[8],k=a[9],m=a[10],l=a[11];b?a!==b&&(b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*-c;b[1]=f*d+k*-c;b[2]=n*d+m*-c;b[3]=g* +d+l*-c;b[8]=e*c+h*d;b[9]=f*c+k*d;b[10]=n*c+m*d;b[11]=g*c+l*d;return b},rotateZ:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[4],k=a[5],m=a[6],l=a[7];b?a!==b&&(b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*c;b[1]=f*d+k*c;b[2]=n*d+m*c;b[3]=g*d+l*c;b[4]=e*-c+h*d;b[5]=f*-c+k*d;b[6]=n*-c+m*d;b[7]=g*-c+l*d;return b},frustum:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2*e/g;n[1]=0; +n[2]=0;n[3]=0;n[4]=0;n[5]=2*e/h;n[6]=0;n[7]=0;n[8]=(d+a)/g;n[9]=(c+b)/h;n[10]=-(f+e)/k;n[11]=-1;n[12]=0;n[13]=0;n[14]=-(2*f*e)/k;n[15]=0;return n},perspective:function(a,d,b,c,e){a=b*Math.tan(a*Math.PI/360);d*=a;return t.frustum(-d,d,-a,a,b,c,e)},ortho:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2/g;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=2/h;n[6]=0;n[7]=0;n[8]=0;n[9]=0;n[10]=-2/k;n[11]=0;n[12]=-(a+d)/g;n[13]=-(c+b)/h;n[14]=-(f+e)/k;n[15]=1;return n},lookAt:function(a,d,b,c){c|| +(c=t.create());var e,f,n,g,h,k,m,l,p=a[0],q=a[1];a=a[2];n=b[0];g=b[1];f=b[2];m=d[0];b=d[1];e=d[2];if(p===m&&q===b&&a===e)return t.identity(c);d=p-m;b=q-b;m=a-e;l=1/Math.sqrt(d*d+b*b+m*m);d*=l;b*=l;m*=l;e=g*m-f*b;f=f*d-n*m;n=n*b-g*d;(l=Math.sqrt(e*e+f*f+n*n))?(l=1/l,e*=l,f*=l,n*=l):n=f=e=0;g=b*n-m*f;h=m*e-d*n;k=d*f-b*e;(l=Math.sqrt(g*g+h*h+k*k))?(l=1/l,g*=l,h*=l,k*=l):k=h=g=0;c[0]=e;c[1]=g;c[2]=d;c[3]=0;c[4]=f;c[5]=h;c[6]=b;c[7]=0;c[8]=n;c[9]=k;c[10]=m;c[11]=0;c[12]=-(e*p+f*q+n*a);c[13]=-(g*p+h*q+ +k*a);c[14]=-(d*p+b*q+m*a);c[15]=1;return c},fromRotationTranslation:function(a,d,b){b||(b=t.create());var c=a[0],e=a[1],f=a[2],n=a[3],g=c+c,h=e+e,k=f+f;a=c*g;var l=c*h,c=c*k,m=e*h,e=e*k,f=f*k,g=n*g,h=n*h,n=n*k;b[0]=1-(m+f);b[1]=l+n;b[2]=c-h;b[3]=0;b[4]=l-n;b[5]=1-(a+f);b[6]=e+g;b[7]=0;b[8]=c+h;b[9]=e-g;b[10]=1-(a+m);b[11]=0;b[12]=d[0];b[13]=d[1];b[14]=d[2];b[15]=1;return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ +a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},m={create:function(a){var d=new k(4);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]):d[0]=d[1]=d[2]=d[3]=0;return d},createFrom:function(a,d,b,c){var e=new k(4);e[0]=a;e[1]=d;e[2]=b;e[3]=c;return e},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])},identity:function(a){a||(a=m.create()); +a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},H=m.identity();m.calculateW=function(a,d){var b=a[0],c=a[1],e=a[2];if(!d||a===d)return a[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e)),a;d[0]=b;d[1]=c;d[2]=e;d[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e));return d};m.dot=function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3]};m.inverse=function(a,d){var b=a[0],c=a[1],e=a[2],f=a[3],b=(b=b*b+c*c+e*e+f*f)?1/b:0;if(!d||a===d)return a[0]*=-b,a[1]*=-b,a[2]*=-b,a[3]*=b,a;d[0]=-a[0]*b;d[1]=-a[1]*b;d[2]=-a[2]*b;d[3]=a[3]*b; +return d};m.conjugate=function(a,d){if(!d||a===d)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=a[3];return d};m.length=function(a){var d=a[0],b=a[1],c=a[2];a=a[3];return Math.sqrt(d*d+b*b+c*c+a*a)};m.normalize=function(a,d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=Math.sqrt(b*b+c*c+e*e+f*f);if(0===g)return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d;g=1/g;d[0]=b*g;d[1]=c*g;d[2]=e*g;d[3]=f*g;return d};m.add=function(a,d,b){if(!b||a===b)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a[3]+= +d[3],a;b[0]=a[0]+d[0];b[1]=a[1]+d[1];b[2]=a[2]+d[2];b[3]=a[3]+d[3];return b};m.multiply=function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2];a=a[3];var g=d[0],h=d[1],k=d[2];d=d[3];b[0]=c*d+a*g+e*k-f*h;b[1]=e*d+a*h+f*g-c*k;b[2]=f*d+a*k+c*h-e*g;b[3]=a*d-c*g-e*h-f*k;return b};m.multiplyVec3=function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=a[0];var g=a[1],h=a[2];a=a[3];var k=a*c+g*f-h*e,l=a*e+h*c-d*f,m=a*f+d*e-g*c,c=-d*c-g*e-h*f;b[0]=k*a+c*-d+l*-h-m*-g;b[1]=l*a+c*-g+m*-d-k*-h;b[2]=m*a+c*-h+k*-g-l*-d; +return b};m.scale=function(a,d,b){if(!b||a===b)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a;b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[3]=a[3]*d;return b};m.toMat3=function(a,d){d||(d=x.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b*k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=m-f;d[4]=1-(l+e);d[5]=c+g;d[6]=b+h;d[7]=c-g;d[8]=1-(l+p);return d};m.toMat4=function(a,d){d||(d=t.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b* +k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=0;d[4]=m-f;d[5]=1-(l+e);d[6]=c+g;d[7]=0;d[8]=b+h;d[9]=c-g;d[10]=1-(l+p);d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d};m.slerp=function(a,d,b,c){c||(c=a);var e=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3],f,g;if(1<=Math.abs(e))return c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]),c;f=Math.acos(e);g=Math.sqrt(1-e*e);if(0.0010>Math.abs(g))return c[0]=0.5*a[0]+0.5*d[0],c[1]=0.5*a[1]+0.5*d[1],c[2]=0.5*a[2]+0.5*d[2],c[3]=0.5*a[3]+ +0.5*d[3],c;e=Math.sin((1-b)*f)/g;b=Math.sin(b*f)/g;c[0]=a[0]*e+d[0]*b;c[1]=a[1]*e+d[1]*b;c[2]=a[2]*e+d[2]*b;c[3]=a[3]*e+d[3]*b;return c};m.fromRotationMatrix=function(a,d){d||(d=m.create());var b=a[0]+a[4]+a[8],c;if(0a[0]&&(b=1);a[8]>a[3*b+b]&&(b=2);var e=c[b],f=c[e];c=Math.sqrt(a[3*b+b]-a[3*e+e]-a[3*f+f]+1);d[b]=0.5*c;c= +0.5/c;d[3]=(a[3*f+e]-a[3*e+f])*c;d[e]=(a[3*e+b]+a[3*b+e])*c;d[f]=(a[3*f+b]+a[3*b+f])*c}return d};x.toQuat4=m.fromRotationMatrix;var B=x.create();m.fromAxes=function(a,d,b,c){B[0]=d[0];B[3]=d[1];B[6]=d[2];B[1]=b[0];B[4]=b[1];B[7]=b[2];B[2]=a[0];B[5]=a[1];B[8]=a[2];return m.fromRotationMatrix(B,c)};m.identity=function(a){a||(a=m.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};m.fromAngleAxis=function(a,d,b){b||(b=m.create());a*=0.5;var c=Math.sin(a);b[3]=Math.cos(a);b[0]=c*d[0];b[1]=c*d[1];b[2]=c*d[2]; +return b};m.toAngleAxis=function(a,d){d||(d=a);var b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); +b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 +Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],e=a[1],f=a[2],g=a[3],h=c*g-f*e;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-e*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, +b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];c[0]=e*b[0]+f*b[2];c[1]=e*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=e*b+f*h;c[1]=e*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var e=b[0];b=b[1];c[0]=e*a[0]+b*a[1];c[1]=e*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var e=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=e*b;c[2]=f*h;c[3]= +g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, +b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| +(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= +f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; +PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; +PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l>1);var b=m[0];return b*(1.5-0.5*a*b*b)}}else g.invsqrt=function(a){return 1/Math.sqrt(a)}; -var l=null;f();var j={create:function(a){var b=new l(3);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0;return b},createFrom:function(a,b,e){var c=new l(3);c[0]=a;c[1]=b;c[2]=e;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])},add:function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];return e},subtract:function(a, -b,e){if(!e||a===e)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];return e},multiply:function(a,b,e){if(!e||a===e)return a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a;e[0]=a[0]*b[0];e[1]=a[1]*b[1];e[2]=a[2]*b[2];return e},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;return e},normalize:function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=Math.sqrt(e* -e+c*c+d*d);if(!k)return b[0]=0,b[1]=0,b[2]=0,b;if(1===k)return b[0]=e,b[1]=c,b[2]=d,b;k=1/k;b[0]=e*k;b[1]=c*k;b[2]=d*k;return b},cross:function(a,b,e){e||(e=a);var c=a[0],d=a[1];a=a[2];var k=b[0],h=b[1];b=b[2];e[0]=d*b-a*h;e[1]=a*k-c*b;e[2]=c*h-d*k;return e},length:function(a){var b=a[0],e=a[1];a=a[2];return Math.sqrt(b*b+e*e+a*a)},squaredLength:function(a){var b=a[0],e=a[1];a=a[2];return b*b+e*e+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,b,e){e||(e=a);var c= -a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];b=Math.sqrt(c*c+d*d+a*a);if(!b)return e[0]=0,e[1]=0,e[2]=0,e;b=1/b;e[0]=c*b;e[1]=d*b;e[2]=a*b;return e},lerp:function(a,b,e,c){c||(c=a);c[0]=a[0]+e*(b[0]-a[0]);c[1]=a[1]+e*(b[1]-a[1]);c[2]=a[2]+e*(b[2]-a[2]);return c},dist:function(a,b){var e=b[0]-a[0],c=b[1]-a[1],d=b[2]-a[2];return Math.sqrt(e*e+c*c+d*d)}},x=null,n=new l(4);j.unproject=function(a,b,e,c,d){d||(d=a);x||(x=y.create());var k=x;n[0]=2*(a[0]-c[0])/c[2]-1;n[1]=2*(a[1]-c[1])/c[3]-1;n[2]=2*a[2]-1;n[3]=1; -y.multiply(e,b,k);if(!y.inverse(k))return null;y.multiplyVec4(k,n);if(0===n[3])return null;d[0]=n[0]/n[3];d[1]=n[1]/n[3];d[2]=n[2]/n[3];return d};var z=j.createFrom(1,0,0),A=j.createFrom(0,1,0),H=j.createFrom(0,0,1),C=j.create();j.rotationTo=function(a,b,e){e||(e=s.create());var c=j.dot(a,b);if(1<=c)s.set(O,e);else if(-0.999999>c)j.cross(z,a,C),1E-6>j.length(C)&&j.cross(A,a,C),1E-6>j.length(C)&&j.cross(H,a,C),j.normalize(C),s.fromAngleAxis(Math.PI,C,e);else{var c=Math.sqrt(2*(1+c)),d=1/c;j.cross(a, -b,C);e[0]=C[0]*d;e[1]=C[1]*d;e[2]=C[2]*d;e[3]=0.5*c;s.normalize(e)}1e[3]&&(e[3]=-1);return e};j.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var F={create:function(a){var b=new l(9);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0;return b},createFrom:function(a,b,e,c,d,k,h,E,K){var q=new l(9);q[0]=a;q[1]=b;q[2]=e;q[3]=c;q[4]=d;q[5]=k;q[6]=h;q[7]=E;q[8]=K;return q},determinant:function(a){var b= -a[3],e=a[4],c=a[5],d=a[6],k=a[7],h=a[8];return a[0]*(h*e-c*k)+a[1]*(-h*b+c*d)+a[2]*(k*b-e*d)},inverse:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],E=a[5],K=a[6],q=a[7],f=a[8],g=f*h-E*q,j=-f*k+E*K,J=q*k-h*K,r=e*g+c*j+d*J;if(!r)return null;r=1/r;b||(b=F.create());b[0]=g*r;b[1]=(-f*c+d*q)*r;b[2]=(E*c-d*h)*r;b[3]=j*r;b[4]=(f*e-d*K)*r;b[5]=(-E*e+d*k)*r;b[6]=J*r;b[7]=(-q*e+c*K)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],E=a[4],f=a[5],q=a[6],g= -a[7];a=a[8];var u=b[0],j=b[1],J=b[2],r=b[3],l=b[4],t=b[5],m=b[6],p=b[7];b=b[8];e[0]=u*c+j*h+J*q;e[1]=u*d+j*E+J*g;e[2]=u*k+j*f+J*a;e[3]=r*c+l*h+t*q;e[4]=r*d+l*E+t*g;e[5]=r*k+l*f+t*a;e[6]=m*c+p*h+b*q;e[7]=m*d+p*E+b*g;e[8]=m*k+p*f+b*a;return e},multiplyVec2:function(a,b,e){e||(e=b);var c=b[0];b=b[1];e[0]=c*a[0]+b*a[3]+a[6];e[1]=c*a[1]+b*a[4]+a[7];return e},multiplyVec3:function(a,b,e){e||(e=b);var c=b[0],d=b[1];b=b[2];e[0]=c*a[0]+d*a[3]+b*a[6];e[1]=c*a[1]+d*a[4]+b*a[7];e[2]=c*a[2]+d*a[5]+b*a[8];return e}, -set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])},identity:function(a){a||(a=F.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, -b){if(!b||a===b){var e=a[1],c=a[2],d=a[5];a[1]=a[3];a[2]=a[6];a[3]=e;a[5]=a[7];a[6]=c;a[7]=d;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]=a[8];return b},toMat4:function(a,b){b||(b=y.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ -a[8]+"]"}},y={create:function(a){var b=new l(16);a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]);return b},createFrom:function(a,b,e,c,d,k,h,E,f,q,g,u,j,J,r,m){var t=new l(16);t[0]=a;t[1]=b;t[2]=e;t[3]=c;t[4]=d;t[5]=k;t[6]=h;t[7]=E;t[8]=f;t[9]=q;t[10]=g;t[11]=u;t[12]=j;t[13]=J;t[14]=r;t[15]=m;return t},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4]; -b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])&&1E-6>Math.abs(a[9]-b[9])&&1E-6>Math.abs(a[10]-b[10])&&1E-6>Math.abs(a[11]-b[11])&&1E-6>Math.abs(a[12]- -b[12])&&1E-6>Math.abs(a[13]-b[13])&&1E-6>Math.abs(a[14]-b[14])&&1E-6>Math.abs(a[15]-b[15])},identity:function(a){a||(a=y.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){var e=a[1],c=a[2],d=a[3],k=a[6],h=a[7],E=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=e;a[6]=a[9];a[7]=a[13];a[8]=c;a[9]=k;a[11]=a[14];a[12]=d;a[13]=h;a[14]=E;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12]; -b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b=a[0],e=a[1],c=a[2],d=a[3],k=a[4],h=a[5],E=a[6],f=a[7],g=a[8],I=a[9],u=a[10],j=a[11],l=a[12],r=a[13],m=a[14];a=a[15];return l*I*E*d-g*r*E*d-l*h*u*d+k*r*u*d+g*h*m*d-k*I*m*d-l*I*c*f+g*r*c*f+l*e*u*f-b*r*u*f-g*e*m*f+b*I*m*f+l*h*c*j-k*r*c*j-l*e*E*j+b*r*E*j+k*e*m*j-b*h*m*j-g*h*c*a+k*I*c*a+g*e*E*a-b*I*E*a-k*e*u*a+b*h*u*a},inverse:function(a, -b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],f=a[5],g=a[6],q=a[7],I=a[8],u=a[9],j=a[10],l=a[11],r=a[12],m=a[13],t=a[14],p=a[15],s=e*f-c*h,n=e*g-d*h,v=e*q-k*h,w=c*g-d*f,x=c*q-k*f,y=d*q-k*g,z=I*m-u*r,A=I*t-j*r,C=I*p-l*r,D=u*t-j*m,F=u*p-l*m,H=j*p-l*t,G=s*H-n*F+v*D+w*C-x*A+y*z;if(!G)return null;G=1/G;b[0]=(f*H-g*F+q*D)*G;b[1]=(-c*H+d*F-k*D)*G;b[2]=(m*y-t*x+p*w)*G;b[3]=(-u*y+j*x-l*w)*G;b[4]=(-h*H+g*C-q*A)*G;b[5]=(e*H-d*C+k*A)*G;b[6]=(-r*y+t*v-p*n)*G;b[7]=(I*y-j*v+l*n)*G;b[8]=(h*F-f*C+q*z)*G;b[9]= -(-e*F+c*C-k*z)*G;b[10]=(r*x-m*v+p*s)*G;b[11]=(-I*x+u*v-l*s)*G;b[12]=(-h*D+f*A-g*z)*G;b[13]=(e*D-c*A+d*z)*G;b[14]=(-r*w+m*n-t*s)*G;b[15]=(I*w-u*n+j*s)*G;return b},toRotationMat:function(a,b){b||(b=y.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=F.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10]; -return b},toInverseMat3:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[4],h=a[5],f=a[6],g=a[8],q=a[9],j=a[10],u=j*h-f*q,l=-j*k+f*g,m=q*k-h*g,r=e*u+c*l+d*m;if(!r)return null;r=1/r;b||(b=F.create());b[0]=u*r;b[1]=(-j*c+d*q)*r;b[2]=(f*c-d*h)*r;b[3]=l*r;b[4]=(j*e-d*g)*r;b[5]=(-f*e+d*k)*r;b[6]=m*r;b[7]=(-q*e+c*g)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],f=a[4],g=a[5],q=a[6],j=a[7],u=a[8],l=a[9],m=a[10],r=a[11],p=a[12],t=a[13],s=a[14];a=a[15];var n=b[0], -B=b[1],v=b[2],w=b[3];e[0]=n*c+B*f+v*u+w*p;e[1]=n*d+B*g+v*l+w*t;e[2]=n*k+B*q+v*m+w*s;e[3]=n*h+B*j+v*r+w*a;n=b[4];B=b[5];v=b[6];w=b[7];e[4]=n*c+B*f+v*u+w*p;e[5]=n*d+B*g+v*l+w*t;e[6]=n*k+B*q+v*m+w*s;e[7]=n*h+B*j+v*r+w*a;n=b[8];B=b[9];v=b[10];w=b[11];e[8]=n*c+B*f+v*u+w*p;e[9]=n*d+B*g+v*l+w*t;e[10]=n*k+B*q+v*m+w*s;e[11]=n*h+B*j+v*r+w*a;n=b[12];B=b[13];v=b[14];w=b[15];e[12]=n*c+B*f+v*u+w*p;e[13]=n*d+B*g+v*l+w*t;e[14]=n*k+B*q+v*m+w*s;e[15]=n*h+B*j+v*r+w*a;return e},multiplyVec3:function(a,b,e){e||(e=b); -var c=b[0],d=b[1];b=b[2];e[0]=a[0]*c+a[4]*d+a[8]*b+a[12];e[1]=a[1]*c+a[5]*d+a[9]*b+a[13];e[2]=a[2]*c+a[6]*d+a[10]*b+a[14];return e},multiplyVec4:function(a,b,e){e||(e=b);var c=b[0],d=b[1],k=b[2];b=b[3];e[0]=a[0]*c+a[4]*d+a[8]*k+a[12]*b;e[1]=a[1]*c+a[5]*d+a[9]*k+a[13]*b;e[2]=a[2]*c+a[6]*d+a[10]*k+a[14]*b;e[3]=a[3]*c+a[7]*d+a[11]*k+a[15]*b;return e},translate:function(a,b,e){var c=b[0],d=b[1];b=b[2];var k,h,f,g,q,j,u,l,m,n,p,s;if(!e||a===e)return a[12]=a[0]*c+a[4]*d+a[8]*b+a[12],a[13]=a[1]*c+a[5]*d+ -a[9]*b+a[13],a[14]=a[2]*c+a[6]*d+a[10]*b+a[14],a[15]=a[3]*c+a[7]*d+a[11]*b+a[15],a;k=a[0];h=a[1];f=a[2];g=a[3];q=a[4];j=a[5];u=a[6];l=a[7];m=a[8];n=a[9];p=a[10];s=a[11];e[0]=k;e[1]=h;e[2]=f;e[3]=g;e[4]=q;e[5]=j;e[6]=u;e[7]=l;e[8]=m;e[9]=n;e[10]=p;e[11]=s;e[12]=k*c+q*d+m*b+a[12];e[13]=h*c+j*d+n*b+a[13];e[14]=f*c+u*d+p*b+a[14];e[15]=g*c+l*d+s*b+a[15];return e},scale:function(a,b,e){var c=b[0],d=b[1];b=b[2];if(!e||a===e)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=d,a[5]*=d,a[6]*=d,a[7]*=d,a[8]*=b,a[9]*= -b,a[10]*=b,a[11]*=b,a;e[0]=a[0]*c;e[1]=a[1]*c;e[2]=a[2]*c;e[3]=a[3]*c;e[4]=a[4]*d;e[5]=a[5]*d;e[6]=a[6]*d;e[7]=a[7]*d;e[8]=a[8]*b;e[9]=a[9]*b;e[10]=a[10]*b;e[11]=a[11]*b;e[12]=a[12];e[13]=a[13];e[14]=a[14];e[15]=a[15];return e},rotate:function(a,b,e,c){var d=e[0],k=e[1];e=e[2];var h=Math.sqrt(d*d+k*k+e*e),f,g,q,j,l,m,n,r,p,s,x,y,B,v,w,z,A,C,D,F;if(!h)return null;1!==h&&(h=1/h,d*=h,k*=h,e*=h);f=Math.sin(b);g=Math.cos(b);q=1-g;b=a[0];h=a[1];j=a[2];l=a[3];m=a[4];n=a[5];r=a[6];p=a[7];s=a[8];x=a[9];y= -a[10];B=a[11];v=d*d*q+g;w=k*d*q+e*f;z=e*d*q-k*f;A=d*k*q-e*f;C=k*k*q+g;D=e*k*q+d*f;F=d*e*q+k*f;d=k*e*q-d*f;k=e*e*q+g;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=b*v+m*w+s*z;c[1]=h*v+n*w+x*z;c[2]=j*v+r*w+y*z;c[3]=l*v+p*w+B*z;c[4]=b*A+m*C+s*D;c[5]=h*A+n*C+x*D;c[6]=j*A+r*C+y*D;c[7]=l*A+p*C+B*D;c[8]=b*F+m*d+s*k;c[9]=h*F+n*d+x*k;c[10]=j*F+r*d+y*k;c[11]=l*F+p*d+B*k;return c},rotateX:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[4],k=a[5],h=a[6],f=a[7],g=a[8],q=a[9],j=a[10], -l=a[11];e?a!==e&&(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[4]=d*b+g*c;e[5]=k*b+q*c;e[6]=h*b+j*c;e[7]=f*b+l*c;e[8]=d*-c+g*b;e[9]=k*-c+q*b;e[10]=h*-c+j*b;e[11]=f*-c+l*b;return e},rotateY:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[8],j=a[9],l=a[10],m=a[11];e?a!==e&&(e[4]=a[4],e[5]=a[5],e[6]=a[6],e[7]=a[7],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*-c;e[1]=k*b+j*-c;e[2]=h*b+l*-c;e[3]=f* -b+m*-c;e[8]=d*c+g*b;e[9]=k*c+j*b;e[10]=h*c+l*b;e[11]=f*c+m*b;return e},rotateZ:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[4],j=a[5],l=a[6],m=a[7];e?a!==e&&(e[8]=a[8],e[9]=a[9],e[10]=a[10],e[11]=a[11],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*c;e[1]=k*b+j*c;e[2]=h*b+l*c;e[3]=f*b+m*c;e[4]=d*-c+g*b;e[5]=k*-c+j*b;e[6]=h*-c+l*b;e[7]=f*-c+m*b;return e},frustum:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2*d/f;h[1]=0; -h[2]=0;h[3]=0;h[4]=0;h[5]=2*d/g;h[6]=0;h[7]=0;h[8]=(b+a)/f;h[9]=(c+e)/g;h[10]=-(k+d)/j;h[11]=-1;h[12]=0;h[13]=0;h[14]=-(2*k*d)/j;h[15]=0;return h},perspective:function(a,b,e,c,d){a=e*Math.tan(a*Math.PI/360);b*=a;return y.frustum(-b,b,-a,a,e,c,d)},ortho:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2/f;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/g;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/j;h[11]=0;h[12]=-(a+b)/f;h[13]=-(c+e)/g;h[14]=-(k+d)/j;h[15]=1;return h},lookAt:function(a,b,e,c){c|| -(c=y.create());var d,k,h,f,g,j,l,m,n=a[0],p=a[1];a=a[2];h=e[0];f=e[1];k=e[2];l=b[0];e=b[1];d=b[2];if(n===l&&p===e&&a===d)return y.identity(c);b=n-l;e=p-e;l=a-d;m=1/Math.sqrt(b*b+e*e+l*l);b*=m;e*=m;l*=m;d=f*l-k*e;k=k*b-h*l;h=h*e-f*b;(m=Math.sqrt(d*d+k*k+h*h))?(m=1/m,d*=m,k*=m,h*=m):h=k=d=0;f=e*h-l*k;g=l*d-b*h;j=b*k-e*d;(m=Math.sqrt(f*f+g*g+j*j))?(m=1/m,f*=m,g*=m,j*=m):j=g=f=0;c[0]=d;c[1]=f;c[2]=b;c[3]=0;c[4]=k;c[5]=g;c[6]=e;c[7]=0;c[8]=h;c[9]=j;c[10]=l;c[11]=0;c[12]=-(d*n+k*p+h*a);c[13]=-(f*n+g*p+ -j*a);c[14]=-(b*n+e*p+l*a);c[15]=1;return c},fromRotationTranslation:function(a,b,e){e||(e=y.create());var c=a[0],d=a[1],k=a[2],h=a[3],f=c+c,g=d+d,j=k+k;a=c*f;var l=c*g,c=c*j,m=d*g,d=d*j,k=k*j,f=h*f,g=h*g,h=h*j;e[0]=1-(m+k);e[1]=l+h;e[2]=c-g;e[3]=0;e[4]=l-h;e[5]=1-(a+k);e[6]=d+f;e[7]=0;e[8]=c+g;e[9]=d-f;e[10]=1-(a+m);e[11]=0;e[12]=b[0];e[13]=b[1];e[14]=b[2];e[15]=1;return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ -a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},s={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,e,c){var d=new l(4);d[0]=a;d[1]=b;d[2]=e;d[3]=c;return d},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=s.create()); -a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},O=s.identity();s.calculateW=function(a,b){var e=a[0],c=a[1],d=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d)),a;b[0]=e;b[1]=c;b[2]=d;b[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d));return b};s.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};s.inverse=function(a,b){var e=a[0],c=a[1],d=a[2],f=a[3],e=(e=e*e+c*c+d*d+f*f)?1/e:0;if(!b||a===b)return a[0]*=-e,a[1]*=-e,a[2]*=-e,a[3]*=e,a;b[0]=-a[0]*e;b[1]=-a[1]*e;b[2]=-a[2]*e;b[3]=a[3]*e; -return b};s.conjugate=function(a,b){if(!b||a===b)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};s.length=function(a){var b=a[0],e=a[1],c=a[2];a=a[3];return Math.sqrt(b*b+e*e+c*c+a*a)};s.normalize=function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],f=a[3],h=Math.sqrt(e*e+c*c+d*d+f*f);if(0===h)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;h=1/h;b[0]=e*h;b[1]=c*h;b[2]=d*h;b[3]=f*h;return b};s.add=function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+= -b[3],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];e[3]=a[3]+b[3];return e};s.multiply=function(a,b,e){e||(e=a);var c=a[0],d=a[1],f=a[2];a=a[3];var h=b[0],g=b[1],j=b[2];b=b[3];e[0]=c*b+a*h+d*j-f*g;e[1]=d*b+a*g+f*h-c*j;e[2]=f*b+a*j+c*g-d*h;e[3]=a*b-c*h-d*g-f*j;return e};s.multiplyVec3=function(a,b,e){e||(e=b);var c=b[0],d=b[1],f=b[2];b=a[0];var h=a[1],g=a[2];a=a[3];var j=a*c+h*f-g*d,l=a*d+g*c-b*f,m=a*f+b*d-h*c,c=-b*c-h*d-g*f;e[0]=j*a+c*-b+l*-g-m*-h;e[1]=l*a+c*-h+m*-b-j*-g;e[2]=m*a+c*-g+j*-h-l*-b; -return e};s.scale=function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a[3]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;e[3]=a[3]*b;return e};s.toMat3=function(a,b){b||(b=F.create());var e=a[0],c=a[1],d=a[2],f=a[3],h=e+e,g=c+c,j=d+d,l=e*h,m=e*g,e=e*j,n=c*g,c=c*j,d=d*j,h=f*h,g=f*g,f=f*j;b[0]=1-(n+d);b[1]=m+f;b[2]=e-g;b[3]=m-f;b[4]=1-(l+d);b[5]=c+h;b[6]=e+g;b[7]=c-h;b[8]=1-(l+n);return b};s.toMat4=function(a,b){b||(b=y.create());var e=a[0],c=a[1],d=a[2],f=a[3],g=e+e,j=c+c,l=d+d,m=e*g,n=e*j,e=e* -l,p=c*j,c=c*l,d=d*l,g=f*g,j=f*j,f=f*l;b[0]=1-(p+d);b[1]=n+f;b[2]=e-j;b[3]=0;b[4]=n-f;b[5]=1-(m+d);b[6]=c+g;b[7]=0;b[8]=e+j;b[9]=c-g;b[10]=1-(m+p);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};s.slerp=function(a,b,c,d){d||(d=a);var f=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],g,h;if(1<=Math.abs(f))return d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d;g=Math.acos(f);h=Math.sqrt(1-f*f);if(0.001>Math.abs(h))return d[0]=0.5*a[0]+0.5*b[0],d[1]=0.5*a[1]+0.5*b[1],d[2]=0.5*a[2]+0.5*b[2],d[3]=0.5*a[3]+ -0.5*b[3],d;f=Math.sin((1-c)*g)/h;c=Math.sin(c*g)/h;d[0]=a[0]*f+b[0]*c;d[1]=a[1]*f+b[1]*c;d[2]=a[2]*f+b[2]*c;d[3]=a[3]*f+b[3]*c;return d};s.fromRotationMatrix=function(a,b){b||(b=s.create());var c=a[0]+a[4]+a[8],d;if(0a[0]&&(c=1);a[8]>a[3*c+c]&&(c=2);var f=d[c],g=d[f];d=Math.sqrt(a[3*c+c]-a[3*f+f]-a[3*g+g]+1);b[c]=0.5*d;d= -0.5/d;b[3]=(a[3*g+f]-a[3*f+g])*d;b[f]=(a[3*f+c]+a[3*c+f])*d;b[g]=(a[3*g+c]+a[3*c+g])*d}return b};F.toQuat4=s.fromRotationMatrix;var D=F.create();s.fromAxes=function(a,b,c,d){D[0]=b[0];D[3]=b[1];D[6]=b[2];D[1]=c[0];D[4]=c[1];D[7]=c[2];D[2]=a[0];D[5]=a[1];D[8]=a[2];return s.fromRotationMatrix(D,d)};s.identity=function(a){a||(a=s.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};s.fromAngleAxis=function(a,b,c){c||(c=s.create());a*=0.5;var d=Math.sin(a);c[3]=Math.cos(a);c[0]=d*b[0];c[1]=d*b[1];c[2]=d*b[2]; -return c};s.toAngleAxis=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); -b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 -Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],f=a[2],g=a[3],h=c*g-f*d;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-d*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, -b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];c[0]=d*b[0]+f*b[2];c[1]=d*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=d*b+f*h;c[1]=d*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var d=b[0];b=b[1];c[0]=d*a[0]+b*a[1];c[1]=d*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var d=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=d*b;c[2]=f*h;c[3]= -g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,d){var f=new l(4);f[0]=a;f[1]=b;f[2]=c;f[3]=d;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, -b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| -(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)},squaredLength:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};c&&(c.glMatrixArrayType=l,c.MatrixArray=l,c.setMatrixArrayType=d,c.determineMatrixArrayType= -f,c.glMath=g,c.vec2=M,c.vec3=j,c.vec4=N,c.mat2=L,c.mat3=F,c.mat4=y,c.quat4=s);return{glMatrixArrayType:l,MatrixArray:l,setMatrixArrayType:d,determineMatrixArrayType:f,glMath:g,vec2:M,vec3:j,vec4:N,mat2:L,mat3:F,mat4:y,quat4:s}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * vColor;","}"]; -PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"]; -PIXI.CompileVertexShader=function(c,d){for(var f="",g=0;g>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/examples/bunny benchmark/index.html b/examples/bunny benchmark/index.html index 7c5521b..95972c4 100644 --- a/examples/bunny benchmark/index.html +++ b/examples/bunny benchmark/index.html @@ -9,9 +9,10 @@ +
    Click to add more bunnys! Let me know how many you get on screen here @doormat23
    - + diff --git a/examples/bunny benchmark/js/bunnyBenchMark.js b/examples/bunny benchmark/js/bunnyBenchMark.js index a3154eb..c3c8ec5 100644 --- a/examples/bunny benchmark/js/bunnyBenchMark.js +++ b/examples/bunny benchmark/js/bunnyBenchMark.js @@ -22,18 +22,13 @@ var count = 0; var container; +var detail; + function onReady() { - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() + detail = document.getElementById("pixi"); - if(webgl) - { - renderer = new PIXI.WebGLRenderer(); - } - else - { - renderer = new PIXI.CanvasRenderer(480, 320); - } + renderer = PIXI.autoDetectRenderer(); stage = new PIXI.Stage; @@ -46,7 +41,7 @@ stats.domElement.style.top = "0px"; requestAnimFrame(update); - wabbitTexture = new PIXI.Texture("wabbit.png") + wabbitTexture = new PIXI.Texture.fromImage("wabbit.png") counter = document.createElement("div"); counter.className = "counter"; @@ -55,7 +50,6 @@ count = startBunnyCount; counter.innerHTML = count + " BUNNIES"; - container = new PIXI.DisplayObjectContainer(); stage.addChild(container); @@ -114,7 +108,9 @@ minX = 0; maxY = height; minY = 0; - + + detail.style.left = width - 204 + "px"; + detail.style.top = height - 100 + "px"; renderer.resize(width, height); } @@ -126,17 +122,17 @@ { // add 10 at a time :) - for (var i = 0; i < 2; i++) + for (var i = 0; i < 10; i++) { - var bunny = new PIXI.Sprite(wabbitTexture, {x:0, y:0, width:26, height:37}); + var bunny = new PIXI.Sprite(wabbitTexture); bunny.speedX = Math.random() * 10; bunny.speedY = (Math.random() * 10) - 5; bunny.anchor.x = 0.5; bunny.anchor.y = 1; - bunny.alpha = 0.3 + Math.random() * 0.7; + //bunny.alpha = 0.3 + Math.random() * 0.7; bunnys.push(bunny); - bunny.rotation = Math.random() - 0.5; + //bunny.rotation = Math.random() - 0.5; container.addChild(bunny); count++; diff --git a/examples/bunny benchmark/js/pixi.js b/examples/bunny benchmark/js/pixi.js new file mode 100644 index 0000000..65add09 --- /dev/null +++ b/examples/bunny benchmark/js/pixi.js @@ -0,0 +1,110 @@ +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, +d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* +j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= +a[0]-d[0],c=a[1]-d[1];a=a[2]-d[2];d=Math.sqrt(b*b+c*c+a*a);if(!d)return j[0]=0,j[1]=0,j[2]=0,j;d=1/d;j[0]=b*d;j[1]=c*d;j[2]=a*d;return j},lerp:function(a,d,j,b){b||(b=a);b[0]=a[0]+j*(d[0]-a[0]);b[1]=a[1]+j*(d[1]-a[1]);b[2]=a[2]+j*(d[2]-a[2]);return b},dist:function(a,d){var j=d[0]-a[0],b=d[1]-a[1],c=d[2]-a[2];return Math.sqrt(j*j+b*b+c*c)}},p=null,q=new k(4);l.unproject=function(a,d,j,b,c){c||(c=a);p||(p=t.create());var e=p;q[0]=2*(a[0]-b[0])/b[2]-1;q[1]=2*(a[1]-b[1])/b[3]-1;q[2]=2*a[2]-1;q[3]=1; +t.multiply(j,d,e);if(!t.inverse(e))return null;t.multiplyVec4(e,q);if(0===q[3])return null;c[0]=q[0]/q[3];c[1]=q[1]/q[3];c[2]=q[2]/q[3];return c};var C=l.createFrom(1,0,0),F=l.createFrom(0,1,0),u=l.createFrom(0,0,1),w=l.create();l.rotationTo=function(a,d,j){j||(j=m.create());var b=l.dot(a,d);if(1<=b)m.set(H,j);else if(-0.999999>b)l.cross(C,a,w),1E-6>l.length(w)&&l.cross(F,a,w),1E-6>l.length(w)&&l.cross(u,a,w),l.normalize(w),m.fromAngleAxis(Math.PI,w,j);else{var b=Math.sqrt(2*(1+b)),c=1/b;l.cross(a, +d,w);j[0]=w[0]*c;j[1]=w[1]*c;j[2]=w[2]*c;j[3]=0.5*b;m.normalize(j)}1j[3]&&(j[3]=-1);return j};l.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var x={create:function(a){var d=new k(9);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8]):d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=0;return d},createFrom:function(a,d,j,b,c,e,n,f,E){var s=new k(9);s[0]=a;s[1]=d;s[2]=j;s[3]=b;s[4]=c;s[5]=e;s[6]=n;s[7]=f;s[8]=E;return s},determinant:function(a){var d= +a[3],j=a[4],b=a[5],c=a[6],e=a[7],n=a[8];return a[0]*(n*j-b*e)+a[1]*(-n*d+b*c)+a[2]*(e*d-j*c)},inverse:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[3],n=a[4],f=a[5],E=a[6],s=a[7],I=a[8],g=I*n-f*s,h=-I*e+f*E,k=s*e-n*E,r=j*g+b*h+c*k;if(!r)return null;r=1/r;d||(d=x.create());d[0]=g*r;d[1]=(-I*b+c*s)*r;d[2]=(f*b-c*n)*r;d[3]=h*r;d[4]=(I*j-c*E)*r;d[5]=(-f*j+c*e)*r;d[6]=k*r;d[7]=(-s*j+b*E)*r;d[8]=(n*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],D=a[4],E=a[5],s=a[6],I= +a[7];a=a[8];var g=d[0],h=d[1],k=d[2],r=d[3],m=d[4],l=d[5],q=d[6],v=d[7];d=d[8];j[0]=g*b+h*f+k*s;j[1]=g*c+h*D+k*I;j[2]=g*e+h*E+k*a;j[3]=r*b+m*f+l*s;j[4]=r*c+m*D+l*I;j[5]=r*e+m*E+l*a;j[6]=q*b+v*f+d*s;j[7]=q*c+v*D+d*I;j[8]=q*e+v*E+d*a;return j},multiplyVec2:function(a,d,j){j||(j=d);var b=d[0];d=d[1];j[0]=b*a[0]+d*a[3]+a[6];j[1]=b*a[1]+d*a[4]+a[7];return j},multiplyVec3:function(a,d,j){j||(j=d);var b=d[0],c=d[1];d=d[2];j[0]=b*a[0]+c*a[3]+d*a[6];j[1]=b*a[1]+c*a[4]+d*a[7];j[2]=b*a[2]+c*a[5]+d*a[8];return j}, +set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])},identity:function(a){a||(a=x.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, +d){if(!d||a===d){var j=a[1],b=a[2],c=a[5];a[1]=a[3];a[2]=a[6];a[3]=j;a[5]=a[7];a[6]=b;a[7]=c;return a}d[0]=a[0];d[1]=a[3];d[2]=a[6];d[3]=a[1];d[4]=a[4];d[5]=a[7];d[6]=a[2];d[7]=a[5];d[8]=a[8];return d},toMat4:function(a,d){d||(d=t.create());d[15]=1;d[14]=0;d[13]=0;d[12]=0;d[11]=0;d[10]=a[8];d[9]=a[7];d[8]=a[6];d[7]=0;d[6]=a[5];d[5]=a[4];d[4]=a[3];d[3]=0;d[2]=a[2];d[1]=a[1];d[0]=a[0];return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ +a[8]+"]"}},t={create:function(a){var d=new k(16);a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8],d[9]=a[9],d[10]=a[10],d[11]=a[11],d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d},createFrom:function(a,d,j,b,c,e,f,D,E,s,g,h,m,l,r,q){var A=new k(16);A[0]=a;A[1]=d;A[2]=j;A[3]=b;A[4]=c;A[5]=e;A[6]=f;A[7]=D;A[8]=E;A[9]=s;A[10]=g;A[11]=h;A[12]=m;A[13]=l;A[14]=r;A[15]=q;return A},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4]; +d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=a[12];d[13]=a[13];d[14]=a[14];d[15]=a[15];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])&&1E-6>Math.abs(a[9]-d[9])&&1E-6>Math.abs(a[10]-d[10])&&1E-6>Math.abs(a[11]-d[11])&&1E-6>Math.abs(a[12]- +d[12])&&1E-6>Math.abs(a[13]-d[13])&&1E-6>Math.abs(a[14]-d[14])&&1E-6>Math.abs(a[15]-d[15])},identity:function(a){a||(a=t.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,d){if(!d||a===d){var j=a[1],b=a[2],c=a[3],e=a[6],f=a[7],D=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=j;a[6]=a[9];a[7]=a[13];a[8]=b;a[9]=e;a[11]=a[14];a[12]=c;a[13]=f;a[14]=D;return a}d[0]=a[0];d[1]=a[4];d[2]=a[8];d[3]=a[12]; +d[4]=a[1];d[5]=a[5];d[6]=a[9];d[7]=a[13];d[8]=a[2];d[9]=a[6];d[10]=a[10];d[11]=a[14];d[12]=a[3];d[13]=a[7];d[14]=a[11];d[15]=a[15];return d},determinant:function(a){var d=a[0],j=a[1],b=a[2],c=a[3],e=a[4],f=a[5],D=a[6],E=a[7],s=a[8],g=a[9],h=a[10],k=a[11],m=a[12],r=a[13],l=a[14];a=a[15];return m*g*D*c-s*r*D*c-m*f*h*c+e*r*h*c+s*f*l*c-e*g*l*c-m*g*b*E+s*r*b*E+m*j*h*E-d*r*h*E-s*j*l*E+d*g*l*E+m*f*b*k-e*r*b*k-m*j*D*k+d*r*D*k+e*j*l*k-d*f*l*k-s*f*b*a+e*g*b*a+s*j*D*a-d*g*D*a-e*j*h*a+d*f*h*a},inverse:function(a, +d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=a[3],f=a[4],D=a[5],E=a[6],s=a[7],g=a[8],h=a[9],k=a[10],m=a[11],r=a[12],l=a[13],A=a[14],q=a[15],v=j*D-b*f,J=j*E-c*f,y=j*s-e*f,z=b*E-c*D,t=b*s-e*D,u=c*s-e*E,p=g*l-h*r,w=g*A-k*r,x=g*q-m*r,B=h*A-k*l,C=h*q-m*l,F=k*q-m*A,G=v*F-J*C+y*B+z*x-t*w+u*p;if(!G)return null;G=1/G;d[0]=(D*F-E*C+s*B)*G;d[1]=(-b*F+c*C-e*B)*G;d[2]=(l*u-A*t+q*z)*G;d[3]=(-h*u+k*t-m*z)*G;d[4]=(-f*F+E*x-s*w)*G;d[5]=(j*F-c*x+e*w)*G;d[6]=(-r*u+A*y-q*J)*G;d[7]=(g*u-k*y+m*J)*G;d[8]=(f*C-D*x+s*p)*G;d[9]= +(-j*C+b*x-e*p)*G;d[10]=(r*t-l*y+q*v)*G;d[11]=(-g*t+h*y-m*v)*G;d[12]=(-f*B+D*w-E*p)*G;d[13]=(j*B-b*w+c*p)*G;d[14]=(-r*z+l*J-A*v)*G;d[15]=(g*z-h*J+k*v)*G;return d},toRotationMat:function(a,d){d||(d=t.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d},toMat3:function(a,d){d||(d=x.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[4];d[4]=a[5];d[5]=a[6];d[6]=a[8];d[7]=a[9];d[8]=a[10]; +return d},toInverseMat3:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[4],f=a[5],D=a[6],g=a[8],s=a[9],h=a[10],k=h*f-D*s,m=-h*e+D*g,l=s*e-f*g,r=j*k+b*m+c*l;if(!r)return null;r=1/r;d||(d=x.create());d[0]=k*r;d[1]=(-h*b+c*s)*r;d[2]=(D*b-c*f)*r;d[3]=m*r;d[4]=(h*j-c*g)*r;d[5]=(-D*j+c*e)*r;d[6]=l*r;d[7]=(-s*j+b*g)*r;d[8]=(f*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],s=a[6],k=a[7],m=a[8],l=a[9],q=a[10],r=a[11],t=a[12],A=a[13],u=a[14];a=a[15];var v=d[0], +p=d[1],y=d[2],z=d[3];j[0]=v*b+p*g+y*m+z*t;j[1]=v*c+p*h+y*l+z*A;j[2]=v*e+p*s+y*q+z*u;j[3]=v*f+p*k+y*r+z*a;v=d[4];p=d[5];y=d[6];z=d[7];j[4]=v*b+p*g+y*m+z*t;j[5]=v*c+p*h+y*l+z*A;j[6]=v*e+p*s+y*q+z*u;j[7]=v*f+p*k+y*r+z*a;v=d[8];p=d[9];y=d[10];z=d[11];j[8]=v*b+p*g+y*m+z*t;j[9]=v*c+p*h+y*l+z*A;j[10]=v*e+p*s+y*q+z*u;j[11]=v*f+p*k+y*r+z*a;v=d[12];p=d[13];y=d[14];z=d[15];j[12]=v*b+p*g+y*m+z*t;j[13]=v*c+p*h+y*l+z*A;j[14]=v*e+p*s+y*q+z*u;j[15]=v*f+p*k+y*r+z*a;return j},multiplyVec3:function(a,d,b){b||(b=d); +var c=d[0],e=d[1];d=d[2];b[0]=a[0]*c+a[4]*e+a[8]*d+a[12];b[1]=a[1]*c+a[5]*e+a[9]*d+a[13];b[2]=a[2]*c+a[6]*e+a[10]*d+a[14];return b},multiplyVec4:function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=d[3];b[0]=a[0]*c+a[4]*e+a[8]*f+a[12]*d;b[1]=a[1]*c+a[5]*e+a[9]*f+a[13]*d;b[2]=a[2]*c+a[6]*e+a[10]*f+a[14]*d;b[3]=a[3]*c+a[7]*e+a[11]*f+a[15]*d;return b},translate:function(a,d,b){var c=d[0],e=d[1];d=d[2];var f,n,g,h,s,k,m,l,p,r,q,t;if(!b||a===b)return a[12]=a[0]*c+a[4]*e+a[8]*d+a[12],a[13]=a[1]*c+a[5]*e+ +a[9]*d+a[13],a[14]=a[2]*c+a[6]*e+a[10]*d+a[14],a[15]=a[3]*c+a[7]*e+a[11]*d+a[15],a;f=a[0];n=a[1];g=a[2];h=a[3];s=a[4];k=a[5];m=a[6];l=a[7];p=a[8];r=a[9];q=a[10];t=a[11];b[0]=f;b[1]=n;b[2]=g;b[3]=h;b[4]=s;b[5]=k;b[6]=m;b[7]=l;b[8]=p;b[9]=r;b[10]=q;b[11]=t;b[12]=f*c+s*e+p*d+a[12];b[13]=n*c+k*e+r*d+a[13];b[14]=g*c+m*e+q*d+a[14];b[15]=h*c+l*e+t*d+a[15];return b},scale:function(a,d,b){var c=d[0],e=d[1];d=d[2];if(!b||a===b)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=d,a[9]*= +d,a[10]*=d,a[11]*=d,a;b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[7]=a[7]*e;b[8]=a[8]*d;b[9]=a[9]*d;b[10]=a[10]*d;b[11]=a[11]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},rotate:function(a,d,b,c){var e=b[0],f=b[1];b=b[2];var n=Math.sqrt(e*e+f*f+b*b),g,h,k,m,l,p,q,r,t,u,w,v,x,y,z,B,C,F,H,K;if(!n)return null;1!==n&&(n=1/n,e*=n,f*=n,b*=n);g=Math.sin(d);h=Math.cos(d);k=1-h;d=a[0];n=a[1];m=a[2];l=a[3];p=a[4];q=a[5];r=a[6];t=a[7];u=a[8];w=a[9];v= +a[10];x=a[11];y=e*e*k+h;z=f*e*k+b*g;B=b*e*k-f*g;C=e*f*k-b*g;F=f*f*k+h;H=b*f*k+e*g;K=e*b*k+f*g;e=f*b*k-e*g;f=b*b*k+h;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=d*y+p*z+u*B;c[1]=n*y+q*z+w*B;c[2]=m*y+r*z+v*B;c[3]=l*y+t*z+x*B;c[4]=d*C+p*F+u*H;c[5]=n*C+q*F+w*H;c[6]=m*C+r*F+v*H;c[7]=l*C+t*F+x*H;c[8]=d*K+p*e+u*f;c[9]=n*K+q*e+w*f;c[10]=m*K+r*e+v*f;c[11]=l*K+t*e+x*f;return c},rotateX:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[4],f=a[5],n=a[6],g=a[7],h=a[8],k=a[9],m=a[10], +l=a[11];b?a!==b&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[4]=e*d+h*c;b[5]=f*d+k*c;b[6]=n*d+m*c;b[7]=g*d+l*c;b[8]=e*-c+h*d;b[9]=f*-c+k*d;b[10]=n*-c+m*d;b[11]=g*-c+l*d;return b},rotateY:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[8],k=a[9],m=a[10],l=a[11];b?a!==b&&(b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*-c;b[1]=f*d+k*-c;b[2]=n*d+m*-c;b[3]=g* +d+l*-c;b[8]=e*c+h*d;b[9]=f*c+k*d;b[10]=n*c+m*d;b[11]=g*c+l*d;return b},rotateZ:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[4],k=a[5],m=a[6],l=a[7];b?a!==b&&(b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*c;b[1]=f*d+k*c;b[2]=n*d+m*c;b[3]=g*d+l*c;b[4]=e*-c+h*d;b[5]=f*-c+k*d;b[6]=n*-c+m*d;b[7]=g*-c+l*d;return b},frustum:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2*e/g;n[1]=0; +n[2]=0;n[3]=0;n[4]=0;n[5]=2*e/h;n[6]=0;n[7]=0;n[8]=(d+a)/g;n[9]=(c+b)/h;n[10]=-(f+e)/k;n[11]=-1;n[12]=0;n[13]=0;n[14]=-(2*f*e)/k;n[15]=0;return n},perspective:function(a,d,b,c,e){a=b*Math.tan(a*Math.PI/360);d*=a;return t.frustum(-d,d,-a,a,b,c,e)},ortho:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2/g;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=2/h;n[6]=0;n[7]=0;n[8]=0;n[9]=0;n[10]=-2/k;n[11]=0;n[12]=-(a+d)/g;n[13]=-(c+b)/h;n[14]=-(f+e)/k;n[15]=1;return n},lookAt:function(a,d,b,c){c|| +(c=t.create());var e,f,n,g,h,k,m,l,p=a[0],q=a[1];a=a[2];n=b[0];g=b[1];f=b[2];m=d[0];b=d[1];e=d[2];if(p===m&&q===b&&a===e)return t.identity(c);d=p-m;b=q-b;m=a-e;l=1/Math.sqrt(d*d+b*b+m*m);d*=l;b*=l;m*=l;e=g*m-f*b;f=f*d-n*m;n=n*b-g*d;(l=Math.sqrt(e*e+f*f+n*n))?(l=1/l,e*=l,f*=l,n*=l):n=f=e=0;g=b*n-m*f;h=m*e-d*n;k=d*f-b*e;(l=Math.sqrt(g*g+h*h+k*k))?(l=1/l,g*=l,h*=l,k*=l):k=h=g=0;c[0]=e;c[1]=g;c[2]=d;c[3]=0;c[4]=f;c[5]=h;c[6]=b;c[7]=0;c[8]=n;c[9]=k;c[10]=m;c[11]=0;c[12]=-(e*p+f*q+n*a);c[13]=-(g*p+h*q+ +k*a);c[14]=-(d*p+b*q+m*a);c[15]=1;return c},fromRotationTranslation:function(a,d,b){b||(b=t.create());var c=a[0],e=a[1],f=a[2],n=a[3],g=c+c,h=e+e,k=f+f;a=c*g;var l=c*h,c=c*k,m=e*h,e=e*k,f=f*k,g=n*g,h=n*h,n=n*k;b[0]=1-(m+f);b[1]=l+n;b[2]=c-h;b[3]=0;b[4]=l-n;b[5]=1-(a+f);b[6]=e+g;b[7]=0;b[8]=c+h;b[9]=e-g;b[10]=1-(a+m);b[11]=0;b[12]=d[0];b[13]=d[1];b[14]=d[2];b[15]=1;return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ +a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},m={create:function(a){var d=new k(4);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]):d[0]=d[1]=d[2]=d[3]=0;return d},createFrom:function(a,d,b,c){var e=new k(4);e[0]=a;e[1]=d;e[2]=b;e[3]=c;return e},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])},identity:function(a){a||(a=m.create()); +a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},H=m.identity();m.calculateW=function(a,d){var b=a[0],c=a[1],e=a[2];if(!d||a===d)return a[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e)),a;d[0]=b;d[1]=c;d[2]=e;d[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e));return d};m.dot=function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3]};m.inverse=function(a,d){var b=a[0],c=a[1],e=a[2],f=a[3],b=(b=b*b+c*c+e*e+f*f)?1/b:0;if(!d||a===d)return a[0]*=-b,a[1]*=-b,a[2]*=-b,a[3]*=b,a;d[0]=-a[0]*b;d[1]=-a[1]*b;d[2]=-a[2]*b;d[3]=a[3]*b; +return d};m.conjugate=function(a,d){if(!d||a===d)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=a[3];return d};m.length=function(a){var d=a[0],b=a[1],c=a[2];a=a[3];return Math.sqrt(d*d+b*b+c*c+a*a)};m.normalize=function(a,d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=Math.sqrt(b*b+c*c+e*e+f*f);if(0===g)return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d;g=1/g;d[0]=b*g;d[1]=c*g;d[2]=e*g;d[3]=f*g;return d};m.add=function(a,d,b){if(!b||a===b)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a[3]+= +d[3],a;b[0]=a[0]+d[0];b[1]=a[1]+d[1];b[2]=a[2]+d[2];b[3]=a[3]+d[3];return b};m.multiply=function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2];a=a[3];var g=d[0],h=d[1],k=d[2];d=d[3];b[0]=c*d+a*g+e*k-f*h;b[1]=e*d+a*h+f*g-c*k;b[2]=f*d+a*k+c*h-e*g;b[3]=a*d-c*g-e*h-f*k;return b};m.multiplyVec3=function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=a[0];var g=a[1],h=a[2];a=a[3];var k=a*c+g*f-h*e,l=a*e+h*c-d*f,m=a*f+d*e-g*c,c=-d*c-g*e-h*f;b[0]=k*a+c*-d+l*-h-m*-g;b[1]=l*a+c*-g+m*-d-k*-h;b[2]=m*a+c*-h+k*-g-l*-d; +return b};m.scale=function(a,d,b){if(!b||a===b)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a;b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[3]=a[3]*d;return b};m.toMat3=function(a,d){d||(d=x.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b*k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=m-f;d[4]=1-(l+e);d[5]=c+g;d[6]=b+h;d[7]=c-g;d[8]=1-(l+p);return d};m.toMat4=function(a,d){d||(d=t.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b* +k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=0;d[4]=m-f;d[5]=1-(l+e);d[6]=c+g;d[7]=0;d[8]=b+h;d[9]=c-g;d[10]=1-(l+p);d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d};m.slerp=function(a,d,b,c){c||(c=a);var e=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3],f,g;if(1<=Math.abs(e))return c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]),c;f=Math.acos(e);g=Math.sqrt(1-e*e);if(0.0010>Math.abs(g))return c[0]=0.5*a[0]+0.5*d[0],c[1]=0.5*a[1]+0.5*d[1],c[2]=0.5*a[2]+0.5*d[2],c[3]=0.5*a[3]+ +0.5*d[3],c;e=Math.sin((1-b)*f)/g;b=Math.sin(b*f)/g;c[0]=a[0]*e+d[0]*b;c[1]=a[1]*e+d[1]*b;c[2]=a[2]*e+d[2]*b;c[3]=a[3]*e+d[3]*b;return c};m.fromRotationMatrix=function(a,d){d||(d=m.create());var b=a[0]+a[4]+a[8],c;if(0a[0]&&(b=1);a[8]>a[3*b+b]&&(b=2);var e=c[b],f=c[e];c=Math.sqrt(a[3*b+b]-a[3*e+e]-a[3*f+f]+1);d[b]=0.5*c;c= +0.5/c;d[3]=(a[3*f+e]-a[3*e+f])*c;d[e]=(a[3*e+b]+a[3*b+e])*c;d[f]=(a[3*f+b]+a[3*b+f])*c}return d};x.toQuat4=m.fromRotationMatrix;var B=x.create();m.fromAxes=function(a,d,b,c){B[0]=d[0];B[3]=d[1];B[6]=d[2];B[1]=b[0];B[4]=b[1];B[7]=b[2];B[2]=a[0];B[5]=a[1];B[8]=a[2];return m.fromRotationMatrix(B,c)};m.identity=function(a){a||(a=m.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};m.fromAngleAxis=function(a,d,b){b||(b=m.create());a*=0.5;var c=Math.sin(a);b[3]=Math.cos(a);b[0]=c*d[0];b[1]=c*d[1];b[2]=c*d[2]; +return b};m.toAngleAxis=function(a,d){d||(d=a);var b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); +b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 +Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],e=a[1],f=a[2],g=a[3],h=c*g-f*e;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-e*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, +b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];c[0]=e*b[0]+f*b[2];c[1]=e*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=e*b+f*h;c[1]=e*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var e=b[0];b=b[1];c[0]=e*a[0]+b*a[1];c[1]=e*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var e=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=e*b;c[2]=f*h;c[3]= +g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, +b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| +(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= +f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; +PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; +PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l>1);var b=m[0];return b*(1.5-0.5*a*b*b)}}else g.invsqrt=function(a){return 1/Math.sqrt(a)}; -var l=null;f();var j={create:function(a){var b=new l(3);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0;return b},createFrom:function(a,b,e){var c=new l(3);c[0]=a;c[1]=b;c[2]=e;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])},add:function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];return e},subtract:function(a, -b,e){if(!e||a===e)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];return e},multiply:function(a,b,e){if(!e||a===e)return a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a;e[0]=a[0]*b[0];e[1]=a[1]*b[1];e[2]=a[2]*b[2];return e},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;return e},normalize:function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=Math.sqrt(e* -e+c*c+d*d);if(!k)return b[0]=0,b[1]=0,b[2]=0,b;if(1===k)return b[0]=e,b[1]=c,b[2]=d,b;k=1/k;b[0]=e*k;b[1]=c*k;b[2]=d*k;return b},cross:function(a,b,e){e||(e=a);var c=a[0],d=a[1];a=a[2];var k=b[0],h=b[1];b=b[2];e[0]=d*b-a*h;e[1]=a*k-c*b;e[2]=c*h-d*k;return e},length:function(a){var b=a[0],e=a[1];a=a[2];return Math.sqrt(b*b+e*e+a*a)},squaredLength:function(a){var b=a[0],e=a[1];a=a[2];return b*b+e*e+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,b,e){e||(e=a);var c= -a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];b=Math.sqrt(c*c+d*d+a*a);if(!b)return e[0]=0,e[1]=0,e[2]=0,e;b=1/b;e[0]=c*b;e[1]=d*b;e[2]=a*b;return e},lerp:function(a,b,e,c){c||(c=a);c[0]=a[0]+e*(b[0]-a[0]);c[1]=a[1]+e*(b[1]-a[1]);c[2]=a[2]+e*(b[2]-a[2]);return c},dist:function(a,b){var e=b[0]-a[0],c=b[1]-a[1],d=b[2]-a[2];return Math.sqrt(e*e+c*c+d*d)}},x=null,n=new l(4);j.unproject=function(a,b,e,c,d){d||(d=a);x||(x=y.create());var k=x;n[0]=2*(a[0]-c[0])/c[2]-1;n[1]=2*(a[1]-c[1])/c[3]-1;n[2]=2*a[2]-1;n[3]=1; -y.multiply(e,b,k);if(!y.inverse(k))return null;y.multiplyVec4(k,n);if(0===n[3])return null;d[0]=n[0]/n[3];d[1]=n[1]/n[3];d[2]=n[2]/n[3];return d};var z=j.createFrom(1,0,0),A=j.createFrom(0,1,0),H=j.createFrom(0,0,1),C=j.create();j.rotationTo=function(a,b,e){e||(e=s.create());var c=j.dot(a,b);if(1<=c)s.set(O,e);else if(-0.999999>c)j.cross(z,a,C),1E-6>j.length(C)&&j.cross(A,a,C),1E-6>j.length(C)&&j.cross(H,a,C),j.normalize(C),s.fromAngleAxis(Math.PI,C,e);else{var c=Math.sqrt(2*(1+c)),d=1/c;j.cross(a, -b,C);e[0]=C[0]*d;e[1]=C[1]*d;e[2]=C[2]*d;e[3]=0.5*c;s.normalize(e)}1e[3]&&(e[3]=-1);return e};j.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var F={create:function(a){var b=new l(9);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0;return b},createFrom:function(a,b,e,c,d,k,h,E,K){var q=new l(9);q[0]=a;q[1]=b;q[2]=e;q[3]=c;q[4]=d;q[5]=k;q[6]=h;q[7]=E;q[8]=K;return q},determinant:function(a){var b= -a[3],e=a[4],c=a[5],d=a[6],k=a[7],h=a[8];return a[0]*(h*e-c*k)+a[1]*(-h*b+c*d)+a[2]*(k*b-e*d)},inverse:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],E=a[5],K=a[6],q=a[7],f=a[8],g=f*h-E*q,j=-f*k+E*K,J=q*k-h*K,r=e*g+c*j+d*J;if(!r)return null;r=1/r;b||(b=F.create());b[0]=g*r;b[1]=(-f*c+d*q)*r;b[2]=(E*c-d*h)*r;b[3]=j*r;b[4]=(f*e-d*K)*r;b[5]=(-E*e+d*k)*r;b[6]=J*r;b[7]=(-q*e+c*K)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],E=a[4],f=a[5],q=a[6],g= -a[7];a=a[8];var u=b[0],j=b[1],J=b[2],r=b[3],l=b[4],t=b[5],m=b[6],p=b[7];b=b[8];e[0]=u*c+j*h+J*q;e[1]=u*d+j*E+J*g;e[2]=u*k+j*f+J*a;e[3]=r*c+l*h+t*q;e[4]=r*d+l*E+t*g;e[5]=r*k+l*f+t*a;e[6]=m*c+p*h+b*q;e[7]=m*d+p*E+b*g;e[8]=m*k+p*f+b*a;return e},multiplyVec2:function(a,b,e){e||(e=b);var c=b[0];b=b[1];e[0]=c*a[0]+b*a[3]+a[6];e[1]=c*a[1]+b*a[4]+a[7];return e},multiplyVec3:function(a,b,e){e||(e=b);var c=b[0],d=b[1];b=b[2];e[0]=c*a[0]+d*a[3]+b*a[6];e[1]=c*a[1]+d*a[4]+b*a[7];e[2]=c*a[2]+d*a[5]+b*a[8];return e}, -set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])},identity:function(a){a||(a=F.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, -b){if(!b||a===b){var e=a[1],c=a[2],d=a[5];a[1]=a[3];a[2]=a[6];a[3]=e;a[5]=a[7];a[6]=c;a[7]=d;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]=a[8];return b},toMat4:function(a,b){b||(b=y.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ -a[8]+"]"}},y={create:function(a){var b=new l(16);a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]);return b},createFrom:function(a,b,e,c,d,k,h,E,f,q,g,u,j,J,r,m){var t=new l(16);t[0]=a;t[1]=b;t[2]=e;t[3]=c;t[4]=d;t[5]=k;t[6]=h;t[7]=E;t[8]=f;t[9]=q;t[10]=g;t[11]=u;t[12]=j;t[13]=J;t[14]=r;t[15]=m;return t},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4]; -b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])&&1E-6>Math.abs(a[9]-b[9])&&1E-6>Math.abs(a[10]-b[10])&&1E-6>Math.abs(a[11]-b[11])&&1E-6>Math.abs(a[12]- -b[12])&&1E-6>Math.abs(a[13]-b[13])&&1E-6>Math.abs(a[14]-b[14])&&1E-6>Math.abs(a[15]-b[15])},identity:function(a){a||(a=y.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){var e=a[1],c=a[2],d=a[3],k=a[6],h=a[7],E=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=e;a[6]=a[9];a[7]=a[13];a[8]=c;a[9]=k;a[11]=a[14];a[12]=d;a[13]=h;a[14]=E;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12]; -b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b=a[0],e=a[1],c=a[2],d=a[3],k=a[4],h=a[5],E=a[6],f=a[7],g=a[8],I=a[9],u=a[10],j=a[11],l=a[12],r=a[13],m=a[14];a=a[15];return l*I*E*d-g*r*E*d-l*h*u*d+k*r*u*d+g*h*m*d-k*I*m*d-l*I*c*f+g*r*c*f+l*e*u*f-b*r*u*f-g*e*m*f+b*I*m*f+l*h*c*j-k*r*c*j-l*e*E*j+b*r*E*j+k*e*m*j-b*h*m*j-g*h*c*a+k*I*c*a+g*e*E*a-b*I*E*a-k*e*u*a+b*h*u*a},inverse:function(a, -b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],f=a[5],g=a[6],q=a[7],I=a[8],u=a[9],j=a[10],l=a[11],r=a[12],m=a[13],t=a[14],p=a[15],s=e*f-c*h,n=e*g-d*h,v=e*q-k*h,w=c*g-d*f,x=c*q-k*f,y=d*q-k*g,z=I*m-u*r,A=I*t-j*r,C=I*p-l*r,D=u*t-j*m,F=u*p-l*m,H=j*p-l*t,G=s*H-n*F+v*D+w*C-x*A+y*z;if(!G)return null;G=1/G;b[0]=(f*H-g*F+q*D)*G;b[1]=(-c*H+d*F-k*D)*G;b[2]=(m*y-t*x+p*w)*G;b[3]=(-u*y+j*x-l*w)*G;b[4]=(-h*H+g*C-q*A)*G;b[5]=(e*H-d*C+k*A)*G;b[6]=(-r*y+t*v-p*n)*G;b[7]=(I*y-j*v+l*n)*G;b[8]=(h*F-f*C+q*z)*G;b[9]= -(-e*F+c*C-k*z)*G;b[10]=(r*x-m*v+p*s)*G;b[11]=(-I*x+u*v-l*s)*G;b[12]=(-h*D+f*A-g*z)*G;b[13]=(e*D-c*A+d*z)*G;b[14]=(-r*w+m*n-t*s)*G;b[15]=(I*w-u*n+j*s)*G;return b},toRotationMat:function(a,b){b||(b=y.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=F.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10]; -return b},toInverseMat3:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[4],h=a[5],f=a[6],g=a[8],q=a[9],j=a[10],u=j*h-f*q,l=-j*k+f*g,m=q*k-h*g,r=e*u+c*l+d*m;if(!r)return null;r=1/r;b||(b=F.create());b[0]=u*r;b[1]=(-j*c+d*q)*r;b[2]=(f*c-d*h)*r;b[3]=l*r;b[4]=(j*e-d*g)*r;b[5]=(-f*e+d*k)*r;b[6]=m*r;b[7]=(-q*e+c*g)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],f=a[4],g=a[5],q=a[6],j=a[7],u=a[8],l=a[9],m=a[10],r=a[11],p=a[12],t=a[13],s=a[14];a=a[15];var n=b[0], -B=b[1],v=b[2],w=b[3];e[0]=n*c+B*f+v*u+w*p;e[1]=n*d+B*g+v*l+w*t;e[2]=n*k+B*q+v*m+w*s;e[3]=n*h+B*j+v*r+w*a;n=b[4];B=b[5];v=b[6];w=b[7];e[4]=n*c+B*f+v*u+w*p;e[5]=n*d+B*g+v*l+w*t;e[6]=n*k+B*q+v*m+w*s;e[7]=n*h+B*j+v*r+w*a;n=b[8];B=b[9];v=b[10];w=b[11];e[8]=n*c+B*f+v*u+w*p;e[9]=n*d+B*g+v*l+w*t;e[10]=n*k+B*q+v*m+w*s;e[11]=n*h+B*j+v*r+w*a;n=b[12];B=b[13];v=b[14];w=b[15];e[12]=n*c+B*f+v*u+w*p;e[13]=n*d+B*g+v*l+w*t;e[14]=n*k+B*q+v*m+w*s;e[15]=n*h+B*j+v*r+w*a;return e},multiplyVec3:function(a,b,e){e||(e=b); -var c=b[0],d=b[1];b=b[2];e[0]=a[0]*c+a[4]*d+a[8]*b+a[12];e[1]=a[1]*c+a[5]*d+a[9]*b+a[13];e[2]=a[2]*c+a[6]*d+a[10]*b+a[14];return e},multiplyVec4:function(a,b,e){e||(e=b);var c=b[0],d=b[1],k=b[2];b=b[3];e[0]=a[0]*c+a[4]*d+a[8]*k+a[12]*b;e[1]=a[1]*c+a[5]*d+a[9]*k+a[13]*b;e[2]=a[2]*c+a[6]*d+a[10]*k+a[14]*b;e[3]=a[3]*c+a[7]*d+a[11]*k+a[15]*b;return e},translate:function(a,b,e){var c=b[0],d=b[1];b=b[2];var k,h,f,g,q,j,u,l,m,n,p,s;if(!e||a===e)return a[12]=a[0]*c+a[4]*d+a[8]*b+a[12],a[13]=a[1]*c+a[5]*d+ -a[9]*b+a[13],a[14]=a[2]*c+a[6]*d+a[10]*b+a[14],a[15]=a[3]*c+a[7]*d+a[11]*b+a[15],a;k=a[0];h=a[1];f=a[2];g=a[3];q=a[4];j=a[5];u=a[6];l=a[7];m=a[8];n=a[9];p=a[10];s=a[11];e[0]=k;e[1]=h;e[2]=f;e[3]=g;e[4]=q;e[5]=j;e[6]=u;e[7]=l;e[8]=m;e[9]=n;e[10]=p;e[11]=s;e[12]=k*c+q*d+m*b+a[12];e[13]=h*c+j*d+n*b+a[13];e[14]=f*c+u*d+p*b+a[14];e[15]=g*c+l*d+s*b+a[15];return e},scale:function(a,b,e){var c=b[0],d=b[1];b=b[2];if(!e||a===e)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=d,a[5]*=d,a[6]*=d,a[7]*=d,a[8]*=b,a[9]*= -b,a[10]*=b,a[11]*=b,a;e[0]=a[0]*c;e[1]=a[1]*c;e[2]=a[2]*c;e[3]=a[3]*c;e[4]=a[4]*d;e[5]=a[5]*d;e[6]=a[6]*d;e[7]=a[7]*d;e[8]=a[8]*b;e[9]=a[9]*b;e[10]=a[10]*b;e[11]=a[11]*b;e[12]=a[12];e[13]=a[13];e[14]=a[14];e[15]=a[15];return e},rotate:function(a,b,e,c){var d=e[0],k=e[1];e=e[2];var h=Math.sqrt(d*d+k*k+e*e),f,g,q,j,l,m,n,r,p,s,x,y,B,v,w,z,A,C,D,F;if(!h)return null;1!==h&&(h=1/h,d*=h,k*=h,e*=h);f=Math.sin(b);g=Math.cos(b);q=1-g;b=a[0];h=a[1];j=a[2];l=a[3];m=a[4];n=a[5];r=a[6];p=a[7];s=a[8];x=a[9];y= -a[10];B=a[11];v=d*d*q+g;w=k*d*q+e*f;z=e*d*q-k*f;A=d*k*q-e*f;C=k*k*q+g;D=e*k*q+d*f;F=d*e*q+k*f;d=k*e*q-d*f;k=e*e*q+g;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=b*v+m*w+s*z;c[1]=h*v+n*w+x*z;c[2]=j*v+r*w+y*z;c[3]=l*v+p*w+B*z;c[4]=b*A+m*C+s*D;c[5]=h*A+n*C+x*D;c[6]=j*A+r*C+y*D;c[7]=l*A+p*C+B*D;c[8]=b*F+m*d+s*k;c[9]=h*F+n*d+x*k;c[10]=j*F+r*d+y*k;c[11]=l*F+p*d+B*k;return c},rotateX:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[4],k=a[5],h=a[6],f=a[7],g=a[8],q=a[9],j=a[10], -l=a[11];e?a!==e&&(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[4]=d*b+g*c;e[5]=k*b+q*c;e[6]=h*b+j*c;e[7]=f*b+l*c;e[8]=d*-c+g*b;e[9]=k*-c+q*b;e[10]=h*-c+j*b;e[11]=f*-c+l*b;return e},rotateY:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[8],j=a[9],l=a[10],m=a[11];e?a!==e&&(e[4]=a[4],e[5]=a[5],e[6]=a[6],e[7]=a[7],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*-c;e[1]=k*b+j*-c;e[2]=h*b+l*-c;e[3]=f* -b+m*-c;e[8]=d*c+g*b;e[9]=k*c+j*b;e[10]=h*c+l*b;e[11]=f*c+m*b;return e},rotateZ:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[4],j=a[5],l=a[6],m=a[7];e?a!==e&&(e[8]=a[8],e[9]=a[9],e[10]=a[10],e[11]=a[11],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*c;e[1]=k*b+j*c;e[2]=h*b+l*c;e[3]=f*b+m*c;e[4]=d*-c+g*b;e[5]=k*-c+j*b;e[6]=h*-c+l*b;e[7]=f*-c+m*b;return e},frustum:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2*d/f;h[1]=0; -h[2]=0;h[3]=0;h[4]=0;h[5]=2*d/g;h[6]=0;h[7]=0;h[8]=(b+a)/f;h[9]=(c+e)/g;h[10]=-(k+d)/j;h[11]=-1;h[12]=0;h[13]=0;h[14]=-(2*k*d)/j;h[15]=0;return h},perspective:function(a,b,e,c,d){a=e*Math.tan(a*Math.PI/360);b*=a;return y.frustum(-b,b,-a,a,e,c,d)},ortho:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2/f;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/g;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/j;h[11]=0;h[12]=-(a+b)/f;h[13]=-(c+e)/g;h[14]=-(k+d)/j;h[15]=1;return h},lookAt:function(a,b,e,c){c|| -(c=y.create());var d,k,h,f,g,j,l,m,n=a[0],p=a[1];a=a[2];h=e[0];f=e[1];k=e[2];l=b[0];e=b[1];d=b[2];if(n===l&&p===e&&a===d)return y.identity(c);b=n-l;e=p-e;l=a-d;m=1/Math.sqrt(b*b+e*e+l*l);b*=m;e*=m;l*=m;d=f*l-k*e;k=k*b-h*l;h=h*e-f*b;(m=Math.sqrt(d*d+k*k+h*h))?(m=1/m,d*=m,k*=m,h*=m):h=k=d=0;f=e*h-l*k;g=l*d-b*h;j=b*k-e*d;(m=Math.sqrt(f*f+g*g+j*j))?(m=1/m,f*=m,g*=m,j*=m):j=g=f=0;c[0]=d;c[1]=f;c[2]=b;c[3]=0;c[4]=k;c[5]=g;c[6]=e;c[7]=0;c[8]=h;c[9]=j;c[10]=l;c[11]=0;c[12]=-(d*n+k*p+h*a);c[13]=-(f*n+g*p+ -j*a);c[14]=-(b*n+e*p+l*a);c[15]=1;return c},fromRotationTranslation:function(a,b,e){e||(e=y.create());var c=a[0],d=a[1],k=a[2],h=a[3],f=c+c,g=d+d,j=k+k;a=c*f;var l=c*g,c=c*j,m=d*g,d=d*j,k=k*j,f=h*f,g=h*g,h=h*j;e[0]=1-(m+k);e[1]=l+h;e[2]=c-g;e[3]=0;e[4]=l-h;e[5]=1-(a+k);e[6]=d+f;e[7]=0;e[8]=c+g;e[9]=d-f;e[10]=1-(a+m);e[11]=0;e[12]=b[0];e[13]=b[1];e[14]=b[2];e[15]=1;return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ -a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},s={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,e,c){var d=new l(4);d[0]=a;d[1]=b;d[2]=e;d[3]=c;return d},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=s.create()); -a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},O=s.identity();s.calculateW=function(a,b){var e=a[0],c=a[1],d=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d)),a;b[0]=e;b[1]=c;b[2]=d;b[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d));return b};s.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};s.inverse=function(a,b){var e=a[0],c=a[1],d=a[2],f=a[3],e=(e=e*e+c*c+d*d+f*f)?1/e:0;if(!b||a===b)return a[0]*=-e,a[1]*=-e,a[2]*=-e,a[3]*=e,a;b[0]=-a[0]*e;b[1]=-a[1]*e;b[2]=-a[2]*e;b[3]=a[3]*e; -return b};s.conjugate=function(a,b){if(!b||a===b)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};s.length=function(a){var b=a[0],e=a[1],c=a[2];a=a[3];return Math.sqrt(b*b+e*e+c*c+a*a)};s.normalize=function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],f=a[3],h=Math.sqrt(e*e+c*c+d*d+f*f);if(0===h)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;h=1/h;b[0]=e*h;b[1]=c*h;b[2]=d*h;b[3]=f*h;return b};s.add=function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+= -b[3],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];e[3]=a[3]+b[3];return e};s.multiply=function(a,b,e){e||(e=a);var c=a[0],d=a[1],f=a[2];a=a[3];var h=b[0],g=b[1],j=b[2];b=b[3];e[0]=c*b+a*h+d*j-f*g;e[1]=d*b+a*g+f*h-c*j;e[2]=f*b+a*j+c*g-d*h;e[3]=a*b-c*h-d*g-f*j;return e};s.multiplyVec3=function(a,b,e){e||(e=b);var c=b[0],d=b[1],f=b[2];b=a[0];var h=a[1],g=a[2];a=a[3];var j=a*c+h*f-g*d,l=a*d+g*c-b*f,m=a*f+b*d-h*c,c=-b*c-h*d-g*f;e[0]=j*a+c*-b+l*-g-m*-h;e[1]=l*a+c*-h+m*-b-j*-g;e[2]=m*a+c*-g+j*-h-l*-b; -return e};s.scale=function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a[3]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;e[3]=a[3]*b;return e};s.toMat3=function(a,b){b||(b=F.create());var e=a[0],c=a[1],d=a[2],f=a[3],h=e+e,g=c+c,j=d+d,l=e*h,m=e*g,e=e*j,n=c*g,c=c*j,d=d*j,h=f*h,g=f*g,f=f*j;b[0]=1-(n+d);b[1]=m+f;b[2]=e-g;b[3]=m-f;b[4]=1-(l+d);b[5]=c+h;b[6]=e+g;b[7]=c-h;b[8]=1-(l+n);return b};s.toMat4=function(a,b){b||(b=y.create());var e=a[0],c=a[1],d=a[2],f=a[3],g=e+e,j=c+c,l=d+d,m=e*g,n=e*j,e=e* -l,p=c*j,c=c*l,d=d*l,g=f*g,j=f*j,f=f*l;b[0]=1-(p+d);b[1]=n+f;b[2]=e-j;b[3]=0;b[4]=n-f;b[5]=1-(m+d);b[6]=c+g;b[7]=0;b[8]=e+j;b[9]=c-g;b[10]=1-(m+p);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};s.slerp=function(a,b,c,d){d||(d=a);var f=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],g,h;if(1<=Math.abs(f))return d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d;g=Math.acos(f);h=Math.sqrt(1-f*f);if(0.001>Math.abs(h))return d[0]=0.5*a[0]+0.5*b[0],d[1]=0.5*a[1]+0.5*b[1],d[2]=0.5*a[2]+0.5*b[2],d[3]=0.5*a[3]+ -0.5*b[3],d;f=Math.sin((1-c)*g)/h;c=Math.sin(c*g)/h;d[0]=a[0]*f+b[0]*c;d[1]=a[1]*f+b[1]*c;d[2]=a[2]*f+b[2]*c;d[3]=a[3]*f+b[3]*c;return d};s.fromRotationMatrix=function(a,b){b||(b=s.create());var c=a[0]+a[4]+a[8],d;if(0a[0]&&(c=1);a[8]>a[3*c+c]&&(c=2);var f=d[c],g=d[f];d=Math.sqrt(a[3*c+c]-a[3*f+f]-a[3*g+g]+1);b[c]=0.5*d;d= -0.5/d;b[3]=(a[3*g+f]-a[3*f+g])*d;b[f]=(a[3*f+c]+a[3*c+f])*d;b[g]=(a[3*g+c]+a[3*c+g])*d}return b};F.toQuat4=s.fromRotationMatrix;var D=F.create();s.fromAxes=function(a,b,c,d){D[0]=b[0];D[3]=b[1];D[6]=b[2];D[1]=c[0];D[4]=c[1];D[7]=c[2];D[2]=a[0];D[5]=a[1];D[8]=a[2];return s.fromRotationMatrix(D,d)};s.identity=function(a){a||(a=s.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};s.fromAngleAxis=function(a,b,c){c||(c=s.create());a*=0.5;var d=Math.sin(a);c[3]=Math.cos(a);c[0]=d*b[0];c[1]=d*b[1];c[2]=d*b[2]; -return c};s.toAngleAxis=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); -b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 -Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],f=a[2],g=a[3],h=c*g-f*d;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-d*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, -b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];c[0]=d*b[0]+f*b[2];c[1]=d*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=d*b+f*h;c[1]=d*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var d=b[0];b=b[1];c[0]=d*a[0]+b*a[1];c[1]=d*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var d=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=d*b;c[2]=f*h;c[3]= -g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,d){var f=new l(4);f[0]=a;f[1]=b;f[2]=c;f[3]=d;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, -b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| -(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)},squaredLength:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};c&&(c.glMatrixArrayType=l,c.MatrixArray=l,c.setMatrixArrayType=d,c.determineMatrixArrayType= -f,c.glMath=g,c.vec2=M,c.vec3=j,c.vec4=N,c.mat2=L,c.mat3=F,c.mat4=y,c.quat4=s);return{glMatrixArrayType:l,MatrixArray:l,setMatrixArrayType:d,determineMatrixArrayType:f,glMath:g,vec2:M,vec3:j,vec4:N,mat2:L,mat3:F,mat4:y,quat4:s}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * vColor;","}"]; -PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"]; -PIXI.CompileVertexShader=function(c,d){for(var f="",g=0;g>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/examples/bunny benchmark/index.html b/examples/bunny benchmark/index.html index 7c5521b..95972c4 100644 --- a/examples/bunny benchmark/index.html +++ b/examples/bunny benchmark/index.html @@ -9,9 +9,10 @@ +
    Click to add more bunnys! Let me know how many you get on screen here @doormat23
    - + diff --git a/examples/bunny benchmark/js/bunnyBenchMark.js b/examples/bunny benchmark/js/bunnyBenchMark.js index a3154eb..c3c8ec5 100644 --- a/examples/bunny benchmark/js/bunnyBenchMark.js +++ b/examples/bunny benchmark/js/bunnyBenchMark.js @@ -22,18 +22,13 @@ var count = 0; var container; +var detail; + function onReady() { - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() + detail = document.getElementById("pixi"); - if(webgl) - { - renderer = new PIXI.WebGLRenderer(); - } - else - { - renderer = new PIXI.CanvasRenderer(480, 320); - } + renderer = PIXI.autoDetectRenderer(); stage = new PIXI.Stage; @@ -46,7 +41,7 @@ stats.domElement.style.top = "0px"; requestAnimFrame(update); - wabbitTexture = new PIXI.Texture("wabbit.png") + wabbitTexture = new PIXI.Texture.fromImage("wabbit.png") counter = document.createElement("div"); counter.className = "counter"; @@ -55,7 +50,6 @@ count = startBunnyCount; counter.innerHTML = count + " BUNNIES"; - container = new PIXI.DisplayObjectContainer(); stage.addChild(container); @@ -114,7 +108,9 @@ minX = 0; maxY = height; minY = 0; - + + detail.style.left = width - 204 + "px"; + detail.style.top = height - 100 + "px"; renderer.resize(width, height); } @@ -126,17 +122,17 @@ { // add 10 at a time :) - for (var i = 0; i < 2; i++) + for (var i = 0; i < 10; i++) { - var bunny = new PIXI.Sprite(wabbitTexture, {x:0, y:0, width:26, height:37}); + var bunny = new PIXI.Sprite(wabbitTexture); bunny.speedX = Math.random() * 10; bunny.speedY = (Math.random() * 10) - 5; bunny.anchor.x = 0.5; bunny.anchor.y = 1; - bunny.alpha = 0.3 + Math.random() * 0.7; + //bunny.alpha = 0.3 + Math.random() * 0.7; bunnys.push(bunny); - bunny.rotation = Math.random() - 0.5; + //bunny.rotation = Math.random() - 0.5; container.addChild(bunny); count++; diff --git a/examples/bunny benchmark/js/pixi.js b/examples/bunny benchmark/js/pixi.js new file mode 100644 index 0000000..65add09 --- /dev/null +++ b/examples/bunny benchmark/js/pixi.js @@ -0,0 +1,110 @@ +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, +d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* +j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= +a[0]-d[0],c=a[1]-d[1];a=a[2]-d[2];d=Math.sqrt(b*b+c*c+a*a);if(!d)return j[0]=0,j[1]=0,j[2]=0,j;d=1/d;j[0]=b*d;j[1]=c*d;j[2]=a*d;return j},lerp:function(a,d,j,b){b||(b=a);b[0]=a[0]+j*(d[0]-a[0]);b[1]=a[1]+j*(d[1]-a[1]);b[2]=a[2]+j*(d[2]-a[2]);return b},dist:function(a,d){var j=d[0]-a[0],b=d[1]-a[1],c=d[2]-a[2];return Math.sqrt(j*j+b*b+c*c)}},p=null,q=new k(4);l.unproject=function(a,d,j,b,c){c||(c=a);p||(p=t.create());var e=p;q[0]=2*(a[0]-b[0])/b[2]-1;q[1]=2*(a[1]-b[1])/b[3]-1;q[2]=2*a[2]-1;q[3]=1; +t.multiply(j,d,e);if(!t.inverse(e))return null;t.multiplyVec4(e,q);if(0===q[3])return null;c[0]=q[0]/q[3];c[1]=q[1]/q[3];c[2]=q[2]/q[3];return c};var C=l.createFrom(1,0,0),F=l.createFrom(0,1,0),u=l.createFrom(0,0,1),w=l.create();l.rotationTo=function(a,d,j){j||(j=m.create());var b=l.dot(a,d);if(1<=b)m.set(H,j);else if(-0.999999>b)l.cross(C,a,w),1E-6>l.length(w)&&l.cross(F,a,w),1E-6>l.length(w)&&l.cross(u,a,w),l.normalize(w),m.fromAngleAxis(Math.PI,w,j);else{var b=Math.sqrt(2*(1+b)),c=1/b;l.cross(a, +d,w);j[0]=w[0]*c;j[1]=w[1]*c;j[2]=w[2]*c;j[3]=0.5*b;m.normalize(j)}1j[3]&&(j[3]=-1);return j};l.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var x={create:function(a){var d=new k(9);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8]):d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=0;return d},createFrom:function(a,d,j,b,c,e,n,f,E){var s=new k(9);s[0]=a;s[1]=d;s[2]=j;s[3]=b;s[4]=c;s[5]=e;s[6]=n;s[7]=f;s[8]=E;return s},determinant:function(a){var d= +a[3],j=a[4],b=a[5],c=a[6],e=a[7],n=a[8];return a[0]*(n*j-b*e)+a[1]*(-n*d+b*c)+a[2]*(e*d-j*c)},inverse:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[3],n=a[4],f=a[5],E=a[6],s=a[7],I=a[8],g=I*n-f*s,h=-I*e+f*E,k=s*e-n*E,r=j*g+b*h+c*k;if(!r)return null;r=1/r;d||(d=x.create());d[0]=g*r;d[1]=(-I*b+c*s)*r;d[2]=(f*b-c*n)*r;d[3]=h*r;d[4]=(I*j-c*E)*r;d[5]=(-f*j+c*e)*r;d[6]=k*r;d[7]=(-s*j+b*E)*r;d[8]=(n*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],D=a[4],E=a[5],s=a[6],I= +a[7];a=a[8];var g=d[0],h=d[1],k=d[2],r=d[3],m=d[4],l=d[5],q=d[6],v=d[7];d=d[8];j[0]=g*b+h*f+k*s;j[1]=g*c+h*D+k*I;j[2]=g*e+h*E+k*a;j[3]=r*b+m*f+l*s;j[4]=r*c+m*D+l*I;j[5]=r*e+m*E+l*a;j[6]=q*b+v*f+d*s;j[7]=q*c+v*D+d*I;j[8]=q*e+v*E+d*a;return j},multiplyVec2:function(a,d,j){j||(j=d);var b=d[0];d=d[1];j[0]=b*a[0]+d*a[3]+a[6];j[1]=b*a[1]+d*a[4]+a[7];return j},multiplyVec3:function(a,d,j){j||(j=d);var b=d[0],c=d[1];d=d[2];j[0]=b*a[0]+c*a[3]+d*a[6];j[1]=b*a[1]+c*a[4]+d*a[7];j[2]=b*a[2]+c*a[5]+d*a[8];return j}, +set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])},identity:function(a){a||(a=x.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, +d){if(!d||a===d){var j=a[1],b=a[2],c=a[5];a[1]=a[3];a[2]=a[6];a[3]=j;a[5]=a[7];a[6]=b;a[7]=c;return a}d[0]=a[0];d[1]=a[3];d[2]=a[6];d[3]=a[1];d[4]=a[4];d[5]=a[7];d[6]=a[2];d[7]=a[5];d[8]=a[8];return d},toMat4:function(a,d){d||(d=t.create());d[15]=1;d[14]=0;d[13]=0;d[12]=0;d[11]=0;d[10]=a[8];d[9]=a[7];d[8]=a[6];d[7]=0;d[6]=a[5];d[5]=a[4];d[4]=a[3];d[3]=0;d[2]=a[2];d[1]=a[1];d[0]=a[0];return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ +a[8]+"]"}},t={create:function(a){var d=new k(16);a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8],d[9]=a[9],d[10]=a[10],d[11]=a[11],d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d},createFrom:function(a,d,j,b,c,e,f,D,E,s,g,h,m,l,r,q){var A=new k(16);A[0]=a;A[1]=d;A[2]=j;A[3]=b;A[4]=c;A[5]=e;A[6]=f;A[7]=D;A[8]=E;A[9]=s;A[10]=g;A[11]=h;A[12]=m;A[13]=l;A[14]=r;A[15]=q;return A},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4]; +d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=a[12];d[13]=a[13];d[14]=a[14];d[15]=a[15];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])&&1E-6>Math.abs(a[9]-d[9])&&1E-6>Math.abs(a[10]-d[10])&&1E-6>Math.abs(a[11]-d[11])&&1E-6>Math.abs(a[12]- +d[12])&&1E-6>Math.abs(a[13]-d[13])&&1E-6>Math.abs(a[14]-d[14])&&1E-6>Math.abs(a[15]-d[15])},identity:function(a){a||(a=t.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,d){if(!d||a===d){var j=a[1],b=a[2],c=a[3],e=a[6],f=a[7],D=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=j;a[6]=a[9];a[7]=a[13];a[8]=b;a[9]=e;a[11]=a[14];a[12]=c;a[13]=f;a[14]=D;return a}d[0]=a[0];d[1]=a[4];d[2]=a[8];d[3]=a[12]; +d[4]=a[1];d[5]=a[5];d[6]=a[9];d[7]=a[13];d[8]=a[2];d[9]=a[6];d[10]=a[10];d[11]=a[14];d[12]=a[3];d[13]=a[7];d[14]=a[11];d[15]=a[15];return d},determinant:function(a){var d=a[0],j=a[1],b=a[2],c=a[3],e=a[4],f=a[5],D=a[6],E=a[7],s=a[8],g=a[9],h=a[10],k=a[11],m=a[12],r=a[13],l=a[14];a=a[15];return m*g*D*c-s*r*D*c-m*f*h*c+e*r*h*c+s*f*l*c-e*g*l*c-m*g*b*E+s*r*b*E+m*j*h*E-d*r*h*E-s*j*l*E+d*g*l*E+m*f*b*k-e*r*b*k-m*j*D*k+d*r*D*k+e*j*l*k-d*f*l*k-s*f*b*a+e*g*b*a+s*j*D*a-d*g*D*a-e*j*h*a+d*f*h*a},inverse:function(a, +d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=a[3],f=a[4],D=a[5],E=a[6],s=a[7],g=a[8],h=a[9],k=a[10],m=a[11],r=a[12],l=a[13],A=a[14],q=a[15],v=j*D-b*f,J=j*E-c*f,y=j*s-e*f,z=b*E-c*D,t=b*s-e*D,u=c*s-e*E,p=g*l-h*r,w=g*A-k*r,x=g*q-m*r,B=h*A-k*l,C=h*q-m*l,F=k*q-m*A,G=v*F-J*C+y*B+z*x-t*w+u*p;if(!G)return null;G=1/G;d[0]=(D*F-E*C+s*B)*G;d[1]=(-b*F+c*C-e*B)*G;d[2]=(l*u-A*t+q*z)*G;d[3]=(-h*u+k*t-m*z)*G;d[4]=(-f*F+E*x-s*w)*G;d[5]=(j*F-c*x+e*w)*G;d[6]=(-r*u+A*y-q*J)*G;d[7]=(g*u-k*y+m*J)*G;d[8]=(f*C-D*x+s*p)*G;d[9]= +(-j*C+b*x-e*p)*G;d[10]=(r*t-l*y+q*v)*G;d[11]=(-g*t+h*y-m*v)*G;d[12]=(-f*B+D*w-E*p)*G;d[13]=(j*B-b*w+c*p)*G;d[14]=(-r*z+l*J-A*v)*G;d[15]=(g*z-h*J+k*v)*G;return d},toRotationMat:function(a,d){d||(d=t.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d},toMat3:function(a,d){d||(d=x.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[4];d[4]=a[5];d[5]=a[6];d[6]=a[8];d[7]=a[9];d[8]=a[10]; +return d},toInverseMat3:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[4],f=a[5],D=a[6],g=a[8],s=a[9],h=a[10],k=h*f-D*s,m=-h*e+D*g,l=s*e-f*g,r=j*k+b*m+c*l;if(!r)return null;r=1/r;d||(d=x.create());d[0]=k*r;d[1]=(-h*b+c*s)*r;d[2]=(D*b-c*f)*r;d[3]=m*r;d[4]=(h*j-c*g)*r;d[5]=(-D*j+c*e)*r;d[6]=l*r;d[7]=(-s*j+b*g)*r;d[8]=(f*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],s=a[6],k=a[7],m=a[8],l=a[9],q=a[10],r=a[11],t=a[12],A=a[13],u=a[14];a=a[15];var v=d[0], +p=d[1],y=d[2],z=d[3];j[0]=v*b+p*g+y*m+z*t;j[1]=v*c+p*h+y*l+z*A;j[2]=v*e+p*s+y*q+z*u;j[3]=v*f+p*k+y*r+z*a;v=d[4];p=d[5];y=d[6];z=d[7];j[4]=v*b+p*g+y*m+z*t;j[5]=v*c+p*h+y*l+z*A;j[6]=v*e+p*s+y*q+z*u;j[7]=v*f+p*k+y*r+z*a;v=d[8];p=d[9];y=d[10];z=d[11];j[8]=v*b+p*g+y*m+z*t;j[9]=v*c+p*h+y*l+z*A;j[10]=v*e+p*s+y*q+z*u;j[11]=v*f+p*k+y*r+z*a;v=d[12];p=d[13];y=d[14];z=d[15];j[12]=v*b+p*g+y*m+z*t;j[13]=v*c+p*h+y*l+z*A;j[14]=v*e+p*s+y*q+z*u;j[15]=v*f+p*k+y*r+z*a;return j},multiplyVec3:function(a,d,b){b||(b=d); +var c=d[0],e=d[1];d=d[2];b[0]=a[0]*c+a[4]*e+a[8]*d+a[12];b[1]=a[1]*c+a[5]*e+a[9]*d+a[13];b[2]=a[2]*c+a[6]*e+a[10]*d+a[14];return b},multiplyVec4:function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=d[3];b[0]=a[0]*c+a[4]*e+a[8]*f+a[12]*d;b[1]=a[1]*c+a[5]*e+a[9]*f+a[13]*d;b[2]=a[2]*c+a[6]*e+a[10]*f+a[14]*d;b[3]=a[3]*c+a[7]*e+a[11]*f+a[15]*d;return b},translate:function(a,d,b){var c=d[0],e=d[1];d=d[2];var f,n,g,h,s,k,m,l,p,r,q,t;if(!b||a===b)return a[12]=a[0]*c+a[4]*e+a[8]*d+a[12],a[13]=a[1]*c+a[5]*e+ +a[9]*d+a[13],a[14]=a[2]*c+a[6]*e+a[10]*d+a[14],a[15]=a[3]*c+a[7]*e+a[11]*d+a[15],a;f=a[0];n=a[1];g=a[2];h=a[3];s=a[4];k=a[5];m=a[6];l=a[7];p=a[8];r=a[9];q=a[10];t=a[11];b[0]=f;b[1]=n;b[2]=g;b[3]=h;b[4]=s;b[5]=k;b[6]=m;b[7]=l;b[8]=p;b[9]=r;b[10]=q;b[11]=t;b[12]=f*c+s*e+p*d+a[12];b[13]=n*c+k*e+r*d+a[13];b[14]=g*c+m*e+q*d+a[14];b[15]=h*c+l*e+t*d+a[15];return b},scale:function(a,d,b){var c=d[0],e=d[1];d=d[2];if(!b||a===b)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=d,a[9]*= +d,a[10]*=d,a[11]*=d,a;b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[7]=a[7]*e;b[8]=a[8]*d;b[9]=a[9]*d;b[10]=a[10]*d;b[11]=a[11]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},rotate:function(a,d,b,c){var e=b[0],f=b[1];b=b[2];var n=Math.sqrt(e*e+f*f+b*b),g,h,k,m,l,p,q,r,t,u,w,v,x,y,z,B,C,F,H,K;if(!n)return null;1!==n&&(n=1/n,e*=n,f*=n,b*=n);g=Math.sin(d);h=Math.cos(d);k=1-h;d=a[0];n=a[1];m=a[2];l=a[3];p=a[4];q=a[5];r=a[6];t=a[7];u=a[8];w=a[9];v= +a[10];x=a[11];y=e*e*k+h;z=f*e*k+b*g;B=b*e*k-f*g;C=e*f*k-b*g;F=f*f*k+h;H=b*f*k+e*g;K=e*b*k+f*g;e=f*b*k-e*g;f=b*b*k+h;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=d*y+p*z+u*B;c[1]=n*y+q*z+w*B;c[2]=m*y+r*z+v*B;c[3]=l*y+t*z+x*B;c[4]=d*C+p*F+u*H;c[5]=n*C+q*F+w*H;c[6]=m*C+r*F+v*H;c[7]=l*C+t*F+x*H;c[8]=d*K+p*e+u*f;c[9]=n*K+q*e+w*f;c[10]=m*K+r*e+v*f;c[11]=l*K+t*e+x*f;return c},rotateX:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[4],f=a[5],n=a[6],g=a[7],h=a[8],k=a[9],m=a[10], +l=a[11];b?a!==b&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[4]=e*d+h*c;b[5]=f*d+k*c;b[6]=n*d+m*c;b[7]=g*d+l*c;b[8]=e*-c+h*d;b[9]=f*-c+k*d;b[10]=n*-c+m*d;b[11]=g*-c+l*d;return b},rotateY:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[8],k=a[9],m=a[10],l=a[11];b?a!==b&&(b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*-c;b[1]=f*d+k*-c;b[2]=n*d+m*-c;b[3]=g* +d+l*-c;b[8]=e*c+h*d;b[9]=f*c+k*d;b[10]=n*c+m*d;b[11]=g*c+l*d;return b},rotateZ:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[4],k=a[5],m=a[6],l=a[7];b?a!==b&&(b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*c;b[1]=f*d+k*c;b[2]=n*d+m*c;b[3]=g*d+l*c;b[4]=e*-c+h*d;b[5]=f*-c+k*d;b[6]=n*-c+m*d;b[7]=g*-c+l*d;return b},frustum:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2*e/g;n[1]=0; +n[2]=0;n[3]=0;n[4]=0;n[5]=2*e/h;n[6]=0;n[7]=0;n[8]=(d+a)/g;n[9]=(c+b)/h;n[10]=-(f+e)/k;n[11]=-1;n[12]=0;n[13]=0;n[14]=-(2*f*e)/k;n[15]=0;return n},perspective:function(a,d,b,c,e){a=b*Math.tan(a*Math.PI/360);d*=a;return t.frustum(-d,d,-a,a,b,c,e)},ortho:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2/g;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=2/h;n[6]=0;n[7]=0;n[8]=0;n[9]=0;n[10]=-2/k;n[11]=0;n[12]=-(a+d)/g;n[13]=-(c+b)/h;n[14]=-(f+e)/k;n[15]=1;return n},lookAt:function(a,d,b,c){c|| +(c=t.create());var e,f,n,g,h,k,m,l,p=a[0],q=a[1];a=a[2];n=b[0];g=b[1];f=b[2];m=d[0];b=d[1];e=d[2];if(p===m&&q===b&&a===e)return t.identity(c);d=p-m;b=q-b;m=a-e;l=1/Math.sqrt(d*d+b*b+m*m);d*=l;b*=l;m*=l;e=g*m-f*b;f=f*d-n*m;n=n*b-g*d;(l=Math.sqrt(e*e+f*f+n*n))?(l=1/l,e*=l,f*=l,n*=l):n=f=e=0;g=b*n-m*f;h=m*e-d*n;k=d*f-b*e;(l=Math.sqrt(g*g+h*h+k*k))?(l=1/l,g*=l,h*=l,k*=l):k=h=g=0;c[0]=e;c[1]=g;c[2]=d;c[3]=0;c[4]=f;c[5]=h;c[6]=b;c[7]=0;c[8]=n;c[9]=k;c[10]=m;c[11]=0;c[12]=-(e*p+f*q+n*a);c[13]=-(g*p+h*q+ +k*a);c[14]=-(d*p+b*q+m*a);c[15]=1;return c},fromRotationTranslation:function(a,d,b){b||(b=t.create());var c=a[0],e=a[1],f=a[2],n=a[3],g=c+c,h=e+e,k=f+f;a=c*g;var l=c*h,c=c*k,m=e*h,e=e*k,f=f*k,g=n*g,h=n*h,n=n*k;b[0]=1-(m+f);b[1]=l+n;b[2]=c-h;b[3]=0;b[4]=l-n;b[5]=1-(a+f);b[6]=e+g;b[7]=0;b[8]=c+h;b[9]=e-g;b[10]=1-(a+m);b[11]=0;b[12]=d[0];b[13]=d[1];b[14]=d[2];b[15]=1;return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ +a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},m={create:function(a){var d=new k(4);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]):d[0]=d[1]=d[2]=d[3]=0;return d},createFrom:function(a,d,b,c){var e=new k(4);e[0]=a;e[1]=d;e[2]=b;e[3]=c;return e},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])},identity:function(a){a||(a=m.create()); +a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},H=m.identity();m.calculateW=function(a,d){var b=a[0],c=a[1],e=a[2];if(!d||a===d)return a[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e)),a;d[0]=b;d[1]=c;d[2]=e;d[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e));return d};m.dot=function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3]};m.inverse=function(a,d){var b=a[0],c=a[1],e=a[2],f=a[3],b=(b=b*b+c*c+e*e+f*f)?1/b:0;if(!d||a===d)return a[0]*=-b,a[1]*=-b,a[2]*=-b,a[3]*=b,a;d[0]=-a[0]*b;d[1]=-a[1]*b;d[2]=-a[2]*b;d[3]=a[3]*b; +return d};m.conjugate=function(a,d){if(!d||a===d)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=a[3];return d};m.length=function(a){var d=a[0],b=a[1],c=a[2];a=a[3];return Math.sqrt(d*d+b*b+c*c+a*a)};m.normalize=function(a,d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=Math.sqrt(b*b+c*c+e*e+f*f);if(0===g)return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d;g=1/g;d[0]=b*g;d[1]=c*g;d[2]=e*g;d[3]=f*g;return d};m.add=function(a,d,b){if(!b||a===b)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a[3]+= +d[3],a;b[0]=a[0]+d[0];b[1]=a[1]+d[1];b[2]=a[2]+d[2];b[3]=a[3]+d[3];return b};m.multiply=function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2];a=a[3];var g=d[0],h=d[1],k=d[2];d=d[3];b[0]=c*d+a*g+e*k-f*h;b[1]=e*d+a*h+f*g-c*k;b[2]=f*d+a*k+c*h-e*g;b[3]=a*d-c*g-e*h-f*k;return b};m.multiplyVec3=function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=a[0];var g=a[1],h=a[2];a=a[3];var k=a*c+g*f-h*e,l=a*e+h*c-d*f,m=a*f+d*e-g*c,c=-d*c-g*e-h*f;b[0]=k*a+c*-d+l*-h-m*-g;b[1]=l*a+c*-g+m*-d-k*-h;b[2]=m*a+c*-h+k*-g-l*-d; +return b};m.scale=function(a,d,b){if(!b||a===b)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a;b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[3]=a[3]*d;return b};m.toMat3=function(a,d){d||(d=x.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b*k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=m-f;d[4]=1-(l+e);d[5]=c+g;d[6]=b+h;d[7]=c-g;d[8]=1-(l+p);return d};m.toMat4=function(a,d){d||(d=t.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b* +k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=0;d[4]=m-f;d[5]=1-(l+e);d[6]=c+g;d[7]=0;d[8]=b+h;d[9]=c-g;d[10]=1-(l+p);d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d};m.slerp=function(a,d,b,c){c||(c=a);var e=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3],f,g;if(1<=Math.abs(e))return c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]),c;f=Math.acos(e);g=Math.sqrt(1-e*e);if(0.0010>Math.abs(g))return c[0]=0.5*a[0]+0.5*d[0],c[1]=0.5*a[1]+0.5*d[1],c[2]=0.5*a[2]+0.5*d[2],c[3]=0.5*a[3]+ +0.5*d[3],c;e=Math.sin((1-b)*f)/g;b=Math.sin(b*f)/g;c[0]=a[0]*e+d[0]*b;c[1]=a[1]*e+d[1]*b;c[2]=a[2]*e+d[2]*b;c[3]=a[3]*e+d[3]*b;return c};m.fromRotationMatrix=function(a,d){d||(d=m.create());var b=a[0]+a[4]+a[8],c;if(0a[0]&&(b=1);a[8]>a[3*b+b]&&(b=2);var e=c[b],f=c[e];c=Math.sqrt(a[3*b+b]-a[3*e+e]-a[3*f+f]+1);d[b]=0.5*c;c= +0.5/c;d[3]=(a[3*f+e]-a[3*e+f])*c;d[e]=(a[3*e+b]+a[3*b+e])*c;d[f]=(a[3*f+b]+a[3*b+f])*c}return d};x.toQuat4=m.fromRotationMatrix;var B=x.create();m.fromAxes=function(a,d,b,c){B[0]=d[0];B[3]=d[1];B[6]=d[2];B[1]=b[0];B[4]=b[1];B[7]=b[2];B[2]=a[0];B[5]=a[1];B[8]=a[2];return m.fromRotationMatrix(B,c)};m.identity=function(a){a||(a=m.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};m.fromAngleAxis=function(a,d,b){b||(b=m.create());a*=0.5;var c=Math.sin(a);b[3]=Math.cos(a);b[0]=c*d[0];b[1]=c*d[1];b[2]=c*d[2]; +return b};m.toAngleAxis=function(a,d){d||(d=a);var b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); +b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 +Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],e=a[1],f=a[2],g=a[3],h=c*g-f*e;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-e*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, +b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];c[0]=e*b[0]+f*b[2];c[1]=e*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=e*b+f*h;c[1]=e*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var e=b[0];b=b[1];c[0]=e*a[0]+b*a[1];c[1]=e*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var e=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=e*b;c[2]=f*h;c[3]= +g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, +b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| +(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= +f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; +PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; +PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l>1);var b=m[0];return b*(1.5-0.5*a*b*b)}}else g.invsqrt=function(a){return 1/Math.sqrt(a)}; -var l=null;f();var j={create:function(a){var b=new l(3);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0;return b},createFrom:function(a,b,e){var c=new l(3);c[0]=a;c[1]=b;c[2]=e;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])},add:function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];return e},subtract:function(a, -b,e){if(!e||a===e)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];return e},multiply:function(a,b,e){if(!e||a===e)return a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a;e[0]=a[0]*b[0];e[1]=a[1]*b[1];e[2]=a[2]*b[2];return e},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;return e},normalize:function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=Math.sqrt(e* -e+c*c+d*d);if(!k)return b[0]=0,b[1]=0,b[2]=0,b;if(1===k)return b[0]=e,b[1]=c,b[2]=d,b;k=1/k;b[0]=e*k;b[1]=c*k;b[2]=d*k;return b},cross:function(a,b,e){e||(e=a);var c=a[0],d=a[1];a=a[2];var k=b[0],h=b[1];b=b[2];e[0]=d*b-a*h;e[1]=a*k-c*b;e[2]=c*h-d*k;return e},length:function(a){var b=a[0],e=a[1];a=a[2];return Math.sqrt(b*b+e*e+a*a)},squaredLength:function(a){var b=a[0],e=a[1];a=a[2];return b*b+e*e+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,b,e){e||(e=a);var c= -a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];b=Math.sqrt(c*c+d*d+a*a);if(!b)return e[0]=0,e[1]=0,e[2]=0,e;b=1/b;e[0]=c*b;e[1]=d*b;e[2]=a*b;return e},lerp:function(a,b,e,c){c||(c=a);c[0]=a[0]+e*(b[0]-a[0]);c[1]=a[1]+e*(b[1]-a[1]);c[2]=a[2]+e*(b[2]-a[2]);return c},dist:function(a,b){var e=b[0]-a[0],c=b[1]-a[1],d=b[2]-a[2];return Math.sqrt(e*e+c*c+d*d)}},x=null,n=new l(4);j.unproject=function(a,b,e,c,d){d||(d=a);x||(x=y.create());var k=x;n[0]=2*(a[0]-c[0])/c[2]-1;n[1]=2*(a[1]-c[1])/c[3]-1;n[2]=2*a[2]-1;n[3]=1; -y.multiply(e,b,k);if(!y.inverse(k))return null;y.multiplyVec4(k,n);if(0===n[3])return null;d[0]=n[0]/n[3];d[1]=n[1]/n[3];d[2]=n[2]/n[3];return d};var z=j.createFrom(1,0,0),A=j.createFrom(0,1,0),H=j.createFrom(0,0,1),C=j.create();j.rotationTo=function(a,b,e){e||(e=s.create());var c=j.dot(a,b);if(1<=c)s.set(O,e);else if(-0.999999>c)j.cross(z,a,C),1E-6>j.length(C)&&j.cross(A,a,C),1E-6>j.length(C)&&j.cross(H,a,C),j.normalize(C),s.fromAngleAxis(Math.PI,C,e);else{var c=Math.sqrt(2*(1+c)),d=1/c;j.cross(a, -b,C);e[0]=C[0]*d;e[1]=C[1]*d;e[2]=C[2]*d;e[3]=0.5*c;s.normalize(e)}1e[3]&&(e[3]=-1);return e};j.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var F={create:function(a){var b=new l(9);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0;return b},createFrom:function(a,b,e,c,d,k,h,E,K){var q=new l(9);q[0]=a;q[1]=b;q[2]=e;q[3]=c;q[4]=d;q[5]=k;q[6]=h;q[7]=E;q[8]=K;return q},determinant:function(a){var b= -a[3],e=a[4],c=a[5],d=a[6],k=a[7],h=a[8];return a[0]*(h*e-c*k)+a[1]*(-h*b+c*d)+a[2]*(k*b-e*d)},inverse:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],E=a[5],K=a[6],q=a[7],f=a[8],g=f*h-E*q,j=-f*k+E*K,J=q*k-h*K,r=e*g+c*j+d*J;if(!r)return null;r=1/r;b||(b=F.create());b[0]=g*r;b[1]=(-f*c+d*q)*r;b[2]=(E*c-d*h)*r;b[3]=j*r;b[4]=(f*e-d*K)*r;b[5]=(-E*e+d*k)*r;b[6]=J*r;b[7]=(-q*e+c*K)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],E=a[4],f=a[5],q=a[6],g= -a[7];a=a[8];var u=b[0],j=b[1],J=b[2],r=b[3],l=b[4],t=b[5],m=b[6],p=b[7];b=b[8];e[0]=u*c+j*h+J*q;e[1]=u*d+j*E+J*g;e[2]=u*k+j*f+J*a;e[3]=r*c+l*h+t*q;e[4]=r*d+l*E+t*g;e[5]=r*k+l*f+t*a;e[6]=m*c+p*h+b*q;e[7]=m*d+p*E+b*g;e[8]=m*k+p*f+b*a;return e},multiplyVec2:function(a,b,e){e||(e=b);var c=b[0];b=b[1];e[0]=c*a[0]+b*a[3]+a[6];e[1]=c*a[1]+b*a[4]+a[7];return e},multiplyVec3:function(a,b,e){e||(e=b);var c=b[0],d=b[1];b=b[2];e[0]=c*a[0]+d*a[3]+b*a[6];e[1]=c*a[1]+d*a[4]+b*a[7];e[2]=c*a[2]+d*a[5]+b*a[8];return e}, -set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])},identity:function(a){a||(a=F.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, -b){if(!b||a===b){var e=a[1],c=a[2],d=a[5];a[1]=a[3];a[2]=a[6];a[3]=e;a[5]=a[7];a[6]=c;a[7]=d;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]=a[8];return b},toMat4:function(a,b){b||(b=y.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ -a[8]+"]"}},y={create:function(a){var b=new l(16);a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]);return b},createFrom:function(a,b,e,c,d,k,h,E,f,q,g,u,j,J,r,m){var t=new l(16);t[0]=a;t[1]=b;t[2]=e;t[3]=c;t[4]=d;t[5]=k;t[6]=h;t[7]=E;t[8]=f;t[9]=q;t[10]=g;t[11]=u;t[12]=j;t[13]=J;t[14]=r;t[15]=m;return t},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4]; -b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])&&1E-6>Math.abs(a[9]-b[9])&&1E-6>Math.abs(a[10]-b[10])&&1E-6>Math.abs(a[11]-b[11])&&1E-6>Math.abs(a[12]- -b[12])&&1E-6>Math.abs(a[13]-b[13])&&1E-6>Math.abs(a[14]-b[14])&&1E-6>Math.abs(a[15]-b[15])},identity:function(a){a||(a=y.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){var e=a[1],c=a[2],d=a[3],k=a[6],h=a[7],E=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=e;a[6]=a[9];a[7]=a[13];a[8]=c;a[9]=k;a[11]=a[14];a[12]=d;a[13]=h;a[14]=E;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12]; -b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b=a[0],e=a[1],c=a[2],d=a[3],k=a[4],h=a[5],E=a[6],f=a[7],g=a[8],I=a[9],u=a[10],j=a[11],l=a[12],r=a[13],m=a[14];a=a[15];return l*I*E*d-g*r*E*d-l*h*u*d+k*r*u*d+g*h*m*d-k*I*m*d-l*I*c*f+g*r*c*f+l*e*u*f-b*r*u*f-g*e*m*f+b*I*m*f+l*h*c*j-k*r*c*j-l*e*E*j+b*r*E*j+k*e*m*j-b*h*m*j-g*h*c*a+k*I*c*a+g*e*E*a-b*I*E*a-k*e*u*a+b*h*u*a},inverse:function(a, -b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],f=a[5],g=a[6],q=a[7],I=a[8],u=a[9],j=a[10],l=a[11],r=a[12],m=a[13],t=a[14],p=a[15],s=e*f-c*h,n=e*g-d*h,v=e*q-k*h,w=c*g-d*f,x=c*q-k*f,y=d*q-k*g,z=I*m-u*r,A=I*t-j*r,C=I*p-l*r,D=u*t-j*m,F=u*p-l*m,H=j*p-l*t,G=s*H-n*F+v*D+w*C-x*A+y*z;if(!G)return null;G=1/G;b[0]=(f*H-g*F+q*D)*G;b[1]=(-c*H+d*F-k*D)*G;b[2]=(m*y-t*x+p*w)*G;b[3]=(-u*y+j*x-l*w)*G;b[4]=(-h*H+g*C-q*A)*G;b[5]=(e*H-d*C+k*A)*G;b[6]=(-r*y+t*v-p*n)*G;b[7]=(I*y-j*v+l*n)*G;b[8]=(h*F-f*C+q*z)*G;b[9]= -(-e*F+c*C-k*z)*G;b[10]=(r*x-m*v+p*s)*G;b[11]=(-I*x+u*v-l*s)*G;b[12]=(-h*D+f*A-g*z)*G;b[13]=(e*D-c*A+d*z)*G;b[14]=(-r*w+m*n-t*s)*G;b[15]=(I*w-u*n+j*s)*G;return b},toRotationMat:function(a,b){b||(b=y.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=F.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10]; -return b},toInverseMat3:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[4],h=a[5],f=a[6],g=a[8],q=a[9],j=a[10],u=j*h-f*q,l=-j*k+f*g,m=q*k-h*g,r=e*u+c*l+d*m;if(!r)return null;r=1/r;b||(b=F.create());b[0]=u*r;b[1]=(-j*c+d*q)*r;b[2]=(f*c-d*h)*r;b[3]=l*r;b[4]=(j*e-d*g)*r;b[5]=(-f*e+d*k)*r;b[6]=m*r;b[7]=(-q*e+c*g)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],f=a[4],g=a[5],q=a[6],j=a[7],u=a[8],l=a[9],m=a[10],r=a[11],p=a[12],t=a[13],s=a[14];a=a[15];var n=b[0], -B=b[1],v=b[2],w=b[3];e[0]=n*c+B*f+v*u+w*p;e[1]=n*d+B*g+v*l+w*t;e[2]=n*k+B*q+v*m+w*s;e[3]=n*h+B*j+v*r+w*a;n=b[4];B=b[5];v=b[6];w=b[7];e[4]=n*c+B*f+v*u+w*p;e[5]=n*d+B*g+v*l+w*t;e[6]=n*k+B*q+v*m+w*s;e[7]=n*h+B*j+v*r+w*a;n=b[8];B=b[9];v=b[10];w=b[11];e[8]=n*c+B*f+v*u+w*p;e[9]=n*d+B*g+v*l+w*t;e[10]=n*k+B*q+v*m+w*s;e[11]=n*h+B*j+v*r+w*a;n=b[12];B=b[13];v=b[14];w=b[15];e[12]=n*c+B*f+v*u+w*p;e[13]=n*d+B*g+v*l+w*t;e[14]=n*k+B*q+v*m+w*s;e[15]=n*h+B*j+v*r+w*a;return e},multiplyVec3:function(a,b,e){e||(e=b); -var c=b[0],d=b[1];b=b[2];e[0]=a[0]*c+a[4]*d+a[8]*b+a[12];e[1]=a[1]*c+a[5]*d+a[9]*b+a[13];e[2]=a[2]*c+a[6]*d+a[10]*b+a[14];return e},multiplyVec4:function(a,b,e){e||(e=b);var c=b[0],d=b[1],k=b[2];b=b[3];e[0]=a[0]*c+a[4]*d+a[8]*k+a[12]*b;e[1]=a[1]*c+a[5]*d+a[9]*k+a[13]*b;e[2]=a[2]*c+a[6]*d+a[10]*k+a[14]*b;e[3]=a[3]*c+a[7]*d+a[11]*k+a[15]*b;return e},translate:function(a,b,e){var c=b[0],d=b[1];b=b[2];var k,h,f,g,q,j,u,l,m,n,p,s;if(!e||a===e)return a[12]=a[0]*c+a[4]*d+a[8]*b+a[12],a[13]=a[1]*c+a[5]*d+ -a[9]*b+a[13],a[14]=a[2]*c+a[6]*d+a[10]*b+a[14],a[15]=a[3]*c+a[7]*d+a[11]*b+a[15],a;k=a[0];h=a[1];f=a[2];g=a[3];q=a[4];j=a[5];u=a[6];l=a[7];m=a[8];n=a[9];p=a[10];s=a[11];e[0]=k;e[1]=h;e[2]=f;e[3]=g;e[4]=q;e[5]=j;e[6]=u;e[7]=l;e[8]=m;e[9]=n;e[10]=p;e[11]=s;e[12]=k*c+q*d+m*b+a[12];e[13]=h*c+j*d+n*b+a[13];e[14]=f*c+u*d+p*b+a[14];e[15]=g*c+l*d+s*b+a[15];return e},scale:function(a,b,e){var c=b[0],d=b[1];b=b[2];if(!e||a===e)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=d,a[5]*=d,a[6]*=d,a[7]*=d,a[8]*=b,a[9]*= -b,a[10]*=b,a[11]*=b,a;e[0]=a[0]*c;e[1]=a[1]*c;e[2]=a[2]*c;e[3]=a[3]*c;e[4]=a[4]*d;e[5]=a[5]*d;e[6]=a[6]*d;e[7]=a[7]*d;e[8]=a[8]*b;e[9]=a[9]*b;e[10]=a[10]*b;e[11]=a[11]*b;e[12]=a[12];e[13]=a[13];e[14]=a[14];e[15]=a[15];return e},rotate:function(a,b,e,c){var d=e[0],k=e[1];e=e[2];var h=Math.sqrt(d*d+k*k+e*e),f,g,q,j,l,m,n,r,p,s,x,y,B,v,w,z,A,C,D,F;if(!h)return null;1!==h&&(h=1/h,d*=h,k*=h,e*=h);f=Math.sin(b);g=Math.cos(b);q=1-g;b=a[0];h=a[1];j=a[2];l=a[3];m=a[4];n=a[5];r=a[6];p=a[7];s=a[8];x=a[9];y= -a[10];B=a[11];v=d*d*q+g;w=k*d*q+e*f;z=e*d*q-k*f;A=d*k*q-e*f;C=k*k*q+g;D=e*k*q+d*f;F=d*e*q+k*f;d=k*e*q-d*f;k=e*e*q+g;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=b*v+m*w+s*z;c[1]=h*v+n*w+x*z;c[2]=j*v+r*w+y*z;c[3]=l*v+p*w+B*z;c[4]=b*A+m*C+s*D;c[5]=h*A+n*C+x*D;c[6]=j*A+r*C+y*D;c[7]=l*A+p*C+B*D;c[8]=b*F+m*d+s*k;c[9]=h*F+n*d+x*k;c[10]=j*F+r*d+y*k;c[11]=l*F+p*d+B*k;return c},rotateX:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[4],k=a[5],h=a[6],f=a[7],g=a[8],q=a[9],j=a[10], -l=a[11];e?a!==e&&(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[4]=d*b+g*c;e[5]=k*b+q*c;e[6]=h*b+j*c;e[7]=f*b+l*c;e[8]=d*-c+g*b;e[9]=k*-c+q*b;e[10]=h*-c+j*b;e[11]=f*-c+l*b;return e},rotateY:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[8],j=a[9],l=a[10],m=a[11];e?a!==e&&(e[4]=a[4],e[5]=a[5],e[6]=a[6],e[7]=a[7],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*-c;e[1]=k*b+j*-c;e[2]=h*b+l*-c;e[3]=f* -b+m*-c;e[8]=d*c+g*b;e[9]=k*c+j*b;e[10]=h*c+l*b;e[11]=f*c+m*b;return e},rotateZ:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[4],j=a[5],l=a[6],m=a[7];e?a!==e&&(e[8]=a[8],e[9]=a[9],e[10]=a[10],e[11]=a[11],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*c;e[1]=k*b+j*c;e[2]=h*b+l*c;e[3]=f*b+m*c;e[4]=d*-c+g*b;e[5]=k*-c+j*b;e[6]=h*-c+l*b;e[7]=f*-c+m*b;return e},frustum:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2*d/f;h[1]=0; -h[2]=0;h[3]=0;h[4]=0;h[5]=2*d/g;h[6]=0;h[7]=0;h[8]=(b+a)/f;h[9]=(c+e)/g;h[10]=-(k+d)/j;h[11]=-1;h[12]=0;h[13]=0;h[14]=-(2*k*d)/j;h[15]=0;return h},perspective:function(a,b,e,c,d){a=e*Math.tan(a*Math.PI/360);b*=a;return y.frustum(-b,b,-a,a,e,c,d)},ortho:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2/f;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/g;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/j;h[11]=0;h[12]=-(a+b)/f;h[13]=-(c+e)/g;h[14]=-(k+d)/j;h[15]=1;return h},lookAt:function(a,b,e,c){c|| -(c=y.create());var d,k,h,f,g,j,l,m,n=a[0],p=a[1];a=a[2];h=e[0];f=e[1];k=e[2];l=b[0];e=b[1];d=b[2];if(n===l&&p===e&&a===d)return y.identity(c);b=n-l;e=p-e;l=a-d;m=1/Math.sqrt(b*b+e*e+l*l);b*=m;e*=m;l*=m;d=f*l-k*e;k=k*b-h*l;h=h*e-f*b;(m=Math.sqrt(d*d+k*k+h*h))?(m=1/m,d*=m,k*=m,h*=m):h=k=d=0;f=e*h-l*k;g=l*d-b*h;j=b*k-e*d;(m=Math.sqrt(f*f+g*g+j*j))?(m=1/m,f*=m,g*=m,j*=m):j=g=f=0;c[0]=d;c[1]=f;c[2]=b;c[3]=0;c[4]=k;c[5]=g;c[6]=e;c[7]=0;c[8]=h;c[9]=j;c[10]=l;c[11]=0;c[12]=-(d*n+k*p+h*a);c[13]=-(f*n+g*p+ -j*a);c[14]=-(b*n+e*p+l*a);c[15]=1;return c},fromRotationTranslation:function(a,b,e){e||(e=y.create());var c=a[0],d=a[1],k=a[2],h=a[3],f=c+c,g=d+d,j=k+k;a=c*f;var l=c*g,c=c*j,m=d*g,d=d*j,k=k*j,f=h*f,g=h*g,h=h*j;e[0]=1-(m+k);e[1]=l+h;e[2]=c-g;e[3]=0;e[4]=l-h;e[5]=1-(a+k);e[6]=d+f;e[7]=0;e[8]=c+g;e[9]=d-f;e[10]=1-(a+m);e[11]=0;e[12]=b[0];e[13]=b[1];e[14]=b[2];e[15]=1;return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ -a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},s={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,e,c){var d=new l(4);d[0]=a;d[1]=b;d[2]=e;d[3]=c;return d},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=s.create()); -a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},O=s.identity();s.calculateW=function(a,b){var e=a[0],c=a[1],d=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d)),a;b[0]=e;b[1]=c;b[2]=d;b[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d));return b};s.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};s.inverse=function(a,b){var e=a[0],c=a[1],d=a[2],f=a[3],e=(e=e*e+c*c+d*d+f*f)?1/e:0;if(!b||a===b)return a[0]*=-e,a[1]*=-e,a[2]*=-e,a[3]*=e,a;b[0]=-a[0]*e;b[1]=-a[1]*e;b[2]=-a[2]*e;b[3]=a[3]*e; -return b};s.conjugate=function(a,b){if(!b||a===b)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};s.length=function(a){var b=a[0],e=a[1],c=a[2];a=a[3];return Math.sqrt(b*b+e*e+c*c+a*a)};s.normalize=function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],f=a[3],h=Math.sqrt(e*e+c*c+d*d+f*f);if(0===h)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;h=1/h;b[0]=e*h;b[1]=c*h;b[2]=d*h;b[3]=f*h;return b};s.add=function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+= -b[3],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];e[3]=a[3]+b[3];return e};s.multiply=function(a,b,e){e||(e=a);var c=a[0],d=a[1],f=a[2];a=a[3];var h=b[0],g=b[1],j=b[2];b=b[3];e[0]=c*b+a*h+d*j-f*g;e[1]=d*b+a*g+f*h-c*j;e[2]=f*b+a*j+c*g-d*h;e[3]=a*b-c*h-d*g-f*j;return e};s.multiplyVec3=function(a,b,e){e||(e=b);var c=b[0],d=b[1],f=b[2];b=a[0];var h=a[1],g=a[2];a=a[3];var j=a*c+h*f-g*d,l=a*d+g*c-b*f,m=a*f+b*d-h*c,c=-b*c-h*d-g*f;e[0]=j*a+c*-b+l*-g-m*-h;e[1]=l*a+c*-h+m*-b-j*-g;e[2]=m*a+c*-g+j*-h-l*-b; -return e};s.scale=function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a[3]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;e[3]=a[3]*b;return e};s.toMat3=function(a,b){b||(b=F.create());var e=a[0],c=a[1],d=a[2],f=a[3],h=e+e,g=c+c,j=d+d,l=e*h,m=e*g,e=e*j,n=c*g,c=c*j,d=d*j,h=f*h,g=f*g,f=f*j;b[0]=1-(n+d);b[1]=m+f;b[2]=e-g;b[3]=m-f;b[4]=1-(l+d);b[5]=c+h;b[6]=e+g;b[7]=c-h;b[8]=1-(l+n);return b};s.toMat4=function(a,b){b||(b=y.create());var e=a[0],c=a[1],d=a[2],f=a[3],g=e+e,j=c+c,l=d+d,m=e*g,n=e*j,e=e* -l,p=c*j,c=c*l,d=d*l,g=f*g,j=f*j,f=f*l;b[0]=1-(p+d);b[1]=n+f;b[2]=e-j;b[3]=0;b[4]=n-f;b[5]=1-(m+d);b[6]=c+g;b[7]=0;b[8]=e+j;b[9]=c-g;b[10]=1-(m+p);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};s.slerp=function(a,b,c,d){d||(d=a);var f=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],g,h;if(1<=Math.abs(f))return d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d;g=Math.acos(f);h=Math.sqrt(1-f*f);if(0.001>Math.abs(h))return d[0]=0.5*a[0]+0.5*b[0],d[1]=0.5*a[1]+0.5*b[1],d[2]=0.5*a[2]+0.5*b[2],d[3]=0.5*a[3]+ -0.5*b[3],d;f=Math.sin((1-c)*g)/h;c=Math.sin(c*g)/h;d[0]=a[0]*f+b[0]*c;d[1]=a[1]*f+b[1]*c;d[2]=a[2]*f+b[2]*c;d[3]=a[3]*f+b[3]*c;return d};s.fromRotationMatrix=function(a,b){b||(b=s.create());var c=a[0]+a[4]+a[8],d;if(0a[0]&&(c=1);a[8]>a[3*c+c]&&(c=2);var f=d[c],g=d[f];d=Math.sqrt(a[3*c+c]-a[3*f+f]-a[3*g+g]+1);b[c]=0.5*d;d= -0.5/d;b[3]=(a[3*g+f]-a[3*f+g])*d;b[f]=(a[3*f+c]+a[3*c+f])*d;b[g]=(a[3*g+c]+a[3*c+g])*d}return b};F.toQuat4=s.fromRotationMatrix;var D=F.create();s.fromAxes=function(a,b,c,d){D[0]=b[0];D[3]=b[1];D[6]=b[2];D[1]=c[0];D[4]=c[1];D[7]=c[2];D[2]=a[0];D[5]=a[1];D[8]=a[2];return s.fromRotationMatrix(D,d)};s.identity=function(a){a||(a=s.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};s.fromAngleAxis=function(a,b,c){c||(c=s.create());a*=0.5;var d=Math.sin(a);c[3]=Math.cos(a);c[0]=d*b[0];c[1]=d*b[1];c[2]=d*b[2]; -return c};s.toAngleAxis=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); -b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 -Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],f=a[2],g=a[3],h=c*g-f*d;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-d*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, -b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];c[0]=d*b[0]+f*b[2];c[1]=d*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=d*b+f*h;c[1]=d*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var d=b[0];b=b[1];c[0]=d*a[0]+b*a[1];c[1]=d*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var d=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=d*b;c[2]=f*h;c[3]= -g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,d){var f=new l(4);f[0]=a;f[1]=b;f[2]=c;f[3]=d;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, -b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| -(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)},squaredLength:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};c&&(c.glMatrixArrayType=l,c.MatrixArray=l,c.setMatrixArrayType=d,c.determineMatrixArrayType= -f,c.glMath=g,c.vec2=M,c.vec3=j,c.vec4=N,c.mat2=L,c.mat3=F,c.mat4=y,c.quat4=s);return{glMatrixArrayType:l,MatrixArray:l,setMatrixArrayType:d,determineMatrixArrayType:f,glMath:g,vec2:M,vec3:j,vec4:N,mat2:L,mat3:F,mat4:y,quat4:s}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * vColor;","}"]; -PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"]; -PIXI.CompileVertexShader=function(c,d){for(var f="",g=0;g>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/examples/bunny benchmark/index.html b/examples/bunny benchmark/index.html index 7c5521b..95972c4 100644 --- a/examples/bunny benchmark/index.html +++ b/examples/bunny benchmark/index.html @@ -9,9 +9,10 @@ +
    Click to add more bunnys! Let me know how many you get on screen here @doormat23
    - + diff --git a/examples/bunny benchmark/js/bunnyBenchMark.js b/examples/bunny benchmark/js/bunnyBenchMark.js index a3154eb..c3c8ec5 100644 --- a/examples/bunny benchmark/js/bunnyBenchMark.js +++ b/examples/bunny benchmark/js/bunnyBenchMark.js @@ -22,18 +22,13 @@ var count = 0; var container; +var detail; + function onReady() { - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() + detail = document.getElementById("pixi"); - if(webgl) - { - renderer = new PIXI.WebGLRenderer(); - } - else - { - renderer = new PIXI.CanvasRenderer(480, 320); - } + renderer = PIXI.autoDetectRenderer(); stage = new PIXI.Stage; @@ -46,7 +41,7 @@ stats.domElement.style.top = "0px"; requestAnimFrame(update); - wabbitTexture = new PIXI.Texture("wabbit.png") + wabbitTexture = new PIXI.Texture.fromImage("wabbit.png") counter = document.createElement("div"); counter.className = "counter"; @@ -55,7 +50,6 @@ count = startBunnyCount; counter.innerHTML = count + " BUNNIES"; - container = new PIXI.DisplayObjectContainer(); stage.addChild(container); @@ -114,7 +108,9 @@ minX = 0; maxY = height; minY = 0; - + + detail.style.left = width - 204 + "px"; + detail.style.top = height - 100 + "px"; renderer.resize(width, height); } @@ -126,17 +122,17 @@ { // add 10 at a time :) - for (var i = 0; i < 2; i++) + for (var i = 0; i < 10; i++) { - var bunny = new PIXI.Sprite(wabbitTexture, {x:0, y:0, width:26, height:37}); + var bunny = new PIXI.Sprite(wabbitTexture); bunny.speedX = Math.random() * 10; bunny.speedY = (Math.random() * 10) - 5; bunny.anchor.x = 0.5; bunny.anchor.y = 1; - bunny.alpha = 0.3 + Math.random() * 0.7; + //bunny.alpha = 0.3 + Math.random() * 0.7; bunnys.push(bunny); - bunny.rotation = Math.random() - 0.5; + //bunny.rotation = Math.random() - 0.5; container.addChild(bunny); count++; diff --git a/examples/bunny benchmark/js/pixi.js b/examples/bunny benchmark/js/pixi.js new file mode 100644 index 0000000..65add09 --- /dev/null +++ b/examples/bunny benchmark/js/pixi.js @@ -0,0 +1,110 @@ +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, +d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* +j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= +a[0]-d[0],c=a[1]-d[1];a=a[2]-d[2];d=Math.sqrt(b*b+c*c+a*a);if(!d)return j[0]=0,j[1]=0,j[2]=0,j;d=1/d;j[0]=b*d;j[1]=c*d;j[2]=a*d;return j},lerp:function(a,d,j,b){b||(b=a);b[0]=a[0]+j*(d[0]-a[0]);b[1]=a[1]+j*(d[1]-a[1]);b[2]=a[2]+j*(d[2]-a[2]);return b},dist:function(a,d){var j=d[0]-a[0],b=d[1]-a[1],c=d[2]-a[2];return Math.sqrt(j*j+b*b+c*c)}},p=null,q=new k(4);l.unproject=function(a,d,j,b,c){c||(c=a);p||(p=t.create());var e=p;q[0]=2*(a[0]-b[0])/b[2]-1;q[1]=2*(a[1]-b[1])/b[3]-1;q[2]=2*a[2]-1;q[3]=1; +t.multiply(j,d,e);if(!t.inverse(e))return null;t.multiplyVec4(e,q);if(0===q[3])return null;c[0]=q[0]/q[3];c[1]=q[1]/q[3];c[2]=q[2]/q[3];return c};var C=l.createFrom(1,0,0),F=l.createFrom(0,1,0),u=l.createFrom(0,0,1),w=l.create();l.rotationTo=function(a,d,j){j||(j=m.create());var b=l.dot(a,d);if(1<=b)m.set(H,j);else if(-0.999999>b)l.cross(C,a,w),1E-6>l.length(w)&&l.cross(F,a,w),1E-6>l.length(w)&&l.cross(u,a,w),l.normalize(w),m.fromAngleAxis(Math.PI,w,j);else{var b=Math.sqrt(2*(1+b)),c=1/b;l.cross(a, +d,w);j[0]=w[0]*c;j[1]=w[1]*c;j[2]=w[2]*c;j[3]=0.5*b;m.normalize(j)}1j[3]&&(j[3]=-1);return j};l.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var x={create:function(a){var d=new k(9);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8]):d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=0;return d},createFrom:function(a,d,j,b,c,e,n,f,E){var s=new k(9);s[0]=a;s[1]=d;s[2]=j;s[3]=b;s[4]=c;s[5]=e;s[6]=n;s[7]=f;s[8]=E;return s},determinant:function(a){var d= +a[3],j=a[4],b=a[5],c=a[6],e=a[7],n=a[8];return a[0]*(n*j-b*e)+a[1]*(-n*d+b*c)+a[2]*(e*d-j*c)},inverse:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[3],n=a[4],f=a[5],E=a[6],s=a[7],I=a[8],g=I*n-f*s,h=-I*e+f*E,k=s*e-n*E,r=j*g+b*h+c*k;if(!r)return null;r=1/r;d||(d=x.create());d[0]=g*r;d[1]=(-I*b+c*s)*r;d[2]=(f*b-c*n)*r;d[3]=h*r;d[4]=(I*j-c*E)*r;d[5]=(-f*j+c*e)*r;d[6]=k*r;d[7]=(-s*j+b*E)*r;d[8]=(n*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],D=a[4],E=a[5],s=a[6],I= +a[7];a=a[8];var g=d[0],h=d[1],k=d[2],r=d[3],m=d[4],l=d[5],q=d[6],v=d[7];d=d[8];j[0]=g*b+h*f+k*s;j[1]=g*c+h*D+k*I;j[2]=g*e+h*E+k*a;j[3]=r*b+m*f+l*s;j[4]=r*c+m*D+l*I;j[5]=r*e+m*E+l*a;j[6]=q*b+v*f+d*s;j[7]=q*c+v*D+d*I;j[8]=q*e+v*E+d*a;return j},multiplyVec2:function(a,d,j){j||(j=d);var b=d[0];d=d[1];j[0]=b*a[0]+d*a[3]+a[6];j[1]=b*a[1]+d*a[4]+a[7];return j},multiplyVec3:function(a,d,j){j||(j=d);var b=d[0],c=d[1];d=d[2];j[0]=b*a[0]+c*a[3]+d*a[6];j[1]=b*a[1]+c*a[4]+d*a[7];j[2]=b*a[2]+c*a[5]+d*a[8];return j}, +set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])},identity:function(a){a||(a=x.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, +d){if(!d||a===d){var j=a[1],b=a[2],c=a[5];a[1]=a[3];a[2]=a[6];a[3]=j;a[5]=a[7];a[6]=b;a[7]=c;return a}d[0]=a[0];d[1]=a[3];d[2]=a[6];d[3]=a[1];d[4]=a[4];d[5]=a[7];d[6]=a[2];d[7]=a[5];d[8]=a[8];return d},toMat4:function(a,d){d||(d=t.create());d[15]=1;d[14]=0;d[13]=0;d[12]=0;d[11]=0;d[10]=a[8];d[9]=a[7];d[8]=a[6];d[7]=0;d[6]=a[5];d[5]=a[4];d[4]=a[3];d[3]=0;d[2]=a[2];d[1]=a[1];d[0]=a[0];return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ +a[8]+"]"}},t={create:function(a){var d=new k(16);a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8],d[9]=a[9],d[10]=a[10],d[11]=a[11],d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d},createFrom:function(a,d,j,b,c,e,f,D,E,s,g,h,m,l,r,q){var A=new k(16);A[0]=a;A[1]=d;A[2]=j;A[3]=b;A[4]=c;A[5]=e;A[6]=f;A[7]=D;A[8]=E;A[9]=s;A[10]=g;A[11]=h;A[12]=m;A[13]=l;A[14]=r;A[15]=q;return A},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4]; +d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=a[12];d[13]=a[13];d[14]=a[14];d[15]=a[15];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])&&1E-6>Math.abs(a[9]-d[9])&&1E-6>Math.abs(a[10]-d[10])&&1E-6>Math.abs(a[11]-d[11])&&1E-6>Math.abs(a[12]- +d[12])&&1E-6>Math.abs(a[13]-d[13])&&1E-6>Math.abs(a[14]-d[14])&&1E-6>Math.abs(a[15]-d[15])},identity:function(a){a||(a=t.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,d){if(!d||a===d){var j=a[1],b=a[2],c=a[3],e=a[6],f=a[7],D=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=j;a[6]=a[9];a[7]=a[13];a[8]=b;a[9]=e;a[11]=a[14];a[12]=c;a[13]=f;a[14]=D;return a}d[0]=a[0];d[1]=a[4];d[2]=a[8];d[3]=a[12]; +d[4]=a[1];d[5]=a[5];d[6]=a[9];d[7]=a[13];d[8]=a[2];d[9]=a[6];d[10]=a[10];d[11]=a[14];d[12]=a[3];d[13]=a[7];d[14]=a[11];d[15]=a[15];return d},determinant:function(a){var d=a[0],j=a[1],b=a[2],c=a[3],e=a[4],f=a[5],D=a[6],E=a[7],s=a[8],g=a[9],h=a[10],k=a[11],m=a[12],r=a[13],l=a[14];a=a[15];return m*g*D*c-s*r*D*c-m*f*h*c+e*r*h*c+s*f*l*c-e*g*l*c-m*g*b*E+s*r*b*E+m*j*h*E-d*r*h*E-s*j*l*E+d*g*l*E+m*f*b*k-e*r*b*k-m*j*D*k+d*r*D*k+e*j*l*k-d*f*l*k-s*f*b*a+e*g*b*a+s*j*D*a-d*g*D*a-e*j*h*a+d*f*h*a},inverse:function(a, +d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=a[3],f=a[4],D=a[5],E=a[6],s=a[7],g=a[8],h=a[9],k=a[10],m=a[11],r=a[12],l=a[13],A=a[14],q=a[15],v=j*D-b*f,J=j*E-c*f,y=j*s-e*f,z=b*E-c*D,t=b*s-e*D,u=c*s-e*E,p=g*l-h*r,w=g*A-k*r,x=g*q-m*r,B=h*A-k*l,C=h*q-m*l,F=k*q-m*A,G=v*F-J*C+y*B+z*x-t*w+u*p;if(!G)return null;G=1/G;d[0]=(D*F-E*C+s*B)*G;d[1]=(-b*F+c*C-e*B)*G;d[2]=(l*u-A*t+q*z)*G;d[3]=(-h*u+k*t-m*z)*G;d[4]=(-f*F+E*x-s*w)*G;d[5]=(j*F-c*x+e*w)*G;d[6]=(-r*u+A*y-q*J)*G;d[7]=(g*u-k*y+m*J)*G;d[8]=(f*C-D*x+s*p)*G;d[9]= +(-j*C+b*x-e*p)*G;d[10]=(r*t-l*y+q*v)*G;d[11]=(-g*t+h*y-m*v)*G;d[12]=(-f*B+D*w-E*p)*G;d[13]=(j*B-b*w+c*p)*G;d[14]=(-r*z+l*J-A*v)*G;d[15]=(g*z-h*J+k*v)*G;return d},toRotationMat:function(a,d){d||(d=t.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d},toMat3:function(a,d){d||(d=x.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[4];d[4]=a[5];d[5]=a[6];d[6]=a[8];d[7]=a[9];d[8]=a[10]; +return d},toInverseMat3:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[4],f=a[5],D=a[6],g=a[8],s=a[9],h=a[10],k=h*f-D*s,m=-h*e+D*g,l=s*e-f*g,r=j*k+b*m+c*l;if(!r)return null;r=1/r;d||(d=x.create());d[0]=k*r;d[1]=(-h*b+c*s)*r;d[2]=(D*b-c*f)*r;d[3]=m*r;d[4]=(h*j-c*g)*r;d[5]=(-D*j+c*e)*r;d[6]=l*r;d[7]=(-s*j+b*g)*r;d[8]=(f*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],s=a[6],k=a[7],m=a[8],l=a[9],q=a[10],r=a[11],t=a[12],A=a[13],u=a[14];a=a[15];var v=d[0], +p=d[1],y=d[2],z=d[3];j[0]=v*b+p*g+y*m+z*t;j[1]=v*c+p*h+y*l+z*A;j[2]=v*e+p*s+y*q+z*u;j[3]=v*f+p*k+y*r+z*a;v=d[4];p=d[5];y=d[6];z=d[7];j[4]=v*b+p*g+y*m+z*t;j[5]=v*c+p*h+y*l+z*A;j[6]=v*e+p*s+y*q+z*u;j[7]=v*f+p*k+y*r+z*a;v=d[8];p=d[9];y=d[10];z=d[11];j[8]=v*b+p*g+y*m+z*t;j[9]=v*c+p*h+y*l+z*A;j[10]=v*e+p*s+y*q+z*u;j[11]=v*f+p*k+y*r+z*a;v=d[12];p=d[13];y=d[14];z=d[15];j[12]=v*b+p*g+y*m+z*t;j[13]=v*c+p*h+y*l+z*A;j[14]=v*e+p*s+y*q+z*u;j[15]=v*f+p*k+y*r+z*a;return j},multiplyVec3:function(a,d,b){b||(b=d); +var c=d[0],e=d[1];d=d[2];b[0]=a[0]*c+a[4]*e+a[8]*d+a[12];b[1]=a[1]*c+a[5]*e+a[9]*d+a[13];b[2]=a[2]*c+a[6]*e+a[10]*d+a[14];return b},multiplyVec4:function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=d[3];b[0]=a[0]*c+a[4]*e+a[8]*f+a[12]*d;b[1]=a[1]*c+a[5]*e+a[9]*f+a[13]*d;b[2]=a[2]*c+a[6]*e+a[10]*f+a[14]*d;b[3]=a[3]*c+a[7]*e+a[11]*f+a[15]*d;return b},translate:function(a,d,b){var c=d[0],e=d[1];d=d[2];var f,n,g,h,s,k,m,l,p,r,q,t;if(!b||a===b)return a[12]=a[0]*c+a[4]*e+a[8]*d+a[12],a[13]=a[1]*c+a[5]*e+ +a[9]*d+a[13],a[14]=a[2]*c+a[6]*e+a[10]*d+a[14],a[15]=a[3]*c+a[7]*e+a[11]*d+a[15],a;f=a[0];n=a[1];g=a[2];h=a[3];s=a[4];k=a[5];m=a[6];l=a[7];p=a[8];r=a[9];q=a[10];t=a[11];b[0]=f;b[1]=n;b[2]=g;b[3]=h;b[4]=s;b[5]=k;b[6]=m;b[7]=l;b[8]=p;b[9]=r;b[10]=q;b[11]=t;b[12]=f*c+s*e+p*d+a[12];b[13]=n*c+k*e+r*d+a[13];b[14]=g*c+m*e+q*d+a[14];b[15]=h*c+l*e+t*d+a[15];return b},scale:function(a,d,b){var c=d[0],e=d[1];d=d[2];if(!b||a===b)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=d,a[9]*= +d,a[10]*=d,a[11]*=d,a;b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[7]=a[7]*e;b[8]=a[8]*d;b[9]=a[9]*d;b[10]=a[10]*d;b[11]=a[11]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},rotate:function(a,d,b,c){var e=b[0],f=b[1];b=b[2];var n=Math.sqrt(e*e+f*f+b*b),g,h,k,m,l,p,q,r,t,u,w,v,x,y,z,B,C,F,H,K;if(!n)return null;1!==n&&(n=1/n,e*=n,f*=n,b*=n);g=Math.sin(d);h=Math.cos(d);k=1-h;d=a[0];n=a[1];m=a[2];l=a[3];p=a[4];q=a[5];r=a[6];t=a[7];u=a[8];w=a[9];v= +a[10];x=a[11];y=e*e*k+h;z=f*e*k+b*g;B=b*e*k-f*g;C=e*f*k-b*g;F=f*f*k+h;H=b*f*k+e*g;K=e*b*k+f*g;e=f*b*k-e*g;f=b*b*k+h;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=d*y+p*z+u*B;c[1]=n*y+q*z+w*B;c[2]=m*y+r*z+v*B;c[3]=l*y+t*z+x*B;c[4]=d*C+p*F+u*H;c[5]=n*C+q*F+w*H;c[6]=m*C+r*F+v*H;c[7]=l*C+t*F+x*H;c[8]=d*K+p*e+u*f;c[9]=n*K+q*e+w*f;c[10]=m*K+r*e+v*f;c[11]=l*K+t*e+x*f;return c},rotateX:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[4],f=a[5],n=a[6],g=a[7],h=a[8],k=a[9],m=a[10], +l=a[11];b?a!==b&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[4]=e*d+h*c;b[5]=f*d+k*c;b[6]=n*d+m*c;b[7]=g*d+l*c;b[8]=e*-c+h*d;b[9]=f*-c+k*d;b[10]=n*-c+m*d;b[11]=g*-c+l*d;return b},rotateY:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[8],k=a[9],m=a[10],l=a[11];b?a!==b&&(b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*-c;b[1]=f*d+k*-c;b[2]=n*d+m*-c;b[3]=g* +d+l*-c;b[8]=e*c+h*d;b[9]=f*c+k*d;b[10]=n*c+m*d;b[11]=g*c+l*d;return b},rotateZ:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[4],k=a[5],m=a[6],l=a[7];b?a!==b&&(b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*c;b[1]=f*d+k*c;b[2]=n*d+m*c;b[3]=g*d+l*c;b[4]=e*-c+h*d;b[5]=f*-c+k*d;b[6]=n*-c+m*d;b[7]=g*-c+l*d;return b},frustum:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2*e/g;n[1]=0; +n[2]=0;n[3]=0;n[4]=0;n[5]=2*e/h;n[6]=0;n[7]=0;n[8]=(d+a)/g;n[9]=(c+b)/h;n[10]=-(f+e)/k;n[11]=-1;n[12]=0;n[13]=0;n[14]=-(2*f*e)/k;n[15]=0;return n},perspective:function(a,d,b,c,e){a=b*Math.tan(a*Math.PI/360);d*=a;return t.frustum(-d,d,-a,a,b,c,e)},ortho:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2/g;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=2/h;n[6]=0;n[7]=0;n[8]=0;n[9]=0;n[10]=-2/k;n[11]=0;n[12]=-(a+d)/g;n[13]=-(c+b)/h;n[14]=-(f+e)/k;n[15]=1;return n},lookAt:function(a,d,b,c){c|| +(c=t.create());var e,f,n,g,h,k,m,l,p=a[0],q=a[1];a=a[2];n=b[0];g=b[1];f=b[2];m=d[0];b=d[1];e=d[2];if(p===m&&q===b&&a===e)return t.identity(c);d=p-m;b=q-b;m=a-e;l=1/Math.sqrt(d*d+b*b+m*m);d*=l;b*=l;m*=l;e=g*m-f*b;f=f*d-n*m;n=n*b-g*d;(l=Math.sqrt(e*e+f*f+n*n))?(l=1/l,e*=l,f*=l,n*=l):n=f=e=0;g=b*n-m*f;h=m*e-d*n;k=d*f-b*e;(l=Math.sqrt(g*g+h*h+k*k))?(l=1/l,g*=l,h*=l,k*=l):k=h=g=0;c[0]=e;c[1]=g;c[2]=d;c[3]=0;c[4]=f;c[5]=h;c[6]=b;c[7]=0;c[8]=n;c[9]=k;c[10]=m;c[11]=0;c[12]=-(e*p+f*q+n*a);c[13]=-(g*p+h*q+ +k*a);c[14]=-(d*p+b*q+m*a);c[15]=1;return c},fromRotationTranslation:function(a,d,b){b||(b=t.create());var c=a[0],e=a[1],f=a[2],n=a[3],g=c+c,h=e+e,k=f+f;a=c*g;var l=c*h,c=c*k,m=e*h,e=e*k,f=f*k,g=n*g,h=n*h,n=n*k;b[0]=1-(m+f);b[1]=l+n;b[2]=c-h;b[3]=0;b[4]=l-n;b[5]=1-(a+f);b[6]=e+g;b[7]=0;b[8]=c+h;b[9]=e-g;b[10]=1-(a+m);b[11]=0;b[12]=d[0];b[13]=d[1];b[14]=d[2];b[15]=1;return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ +a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},m={create:function(a){var d=new k(4);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]):d[0]=d[1]=d[2]=d[3]=0;return d},createFrom:function(a,d,b,c){var e=new k(4);e[0]=a;e[1]=d;e[2]=b;e[3]=c;return e},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])},identity:function(a){a||(a=m.create()); +a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},H=m.identity();m.calculateW=function(a,d){var b=a[0],c=a[1],e=a[2];if(!d||a===d)return a[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e)),a;d[0]=b;d[1]=c;d[2]=e;d[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e));return d};m.dot=function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3]};m.inverse=function(a,d){var b=a[0],c=a[1],e=a[2],f=a[3],b=(b=b*b+c*c+e*e+f*f)?1/b:0;if(!d||a===d)return a[0]*=-b,a[1]*=-b,a[2]*=-b,a[3]*=b,a;d[0]=-a[0]*b;d[1]=-a[1]*b;d[2]=-a[2]*b;d[3]=a[3]*b; +return d};m.conjugate=function(a,d){if(!d||a===d)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=a[3];return d};m.length=function(a){var d=a[0],b=a[1],c=a[2];a=a[3];return Math.sqrt(d*d+b*b+c*c+a*a)};m.normalize=function(a,d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=Math.sqrt(b*b+c*c+e*e+f*f);if(0===g)return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d;g=1/g;d[0]=b*g;d[1]=c*g;d[2]=e*g;d[3]=f*g;return d};m.add=function(a,d,b){if(!b||a===b)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a[3]+= +d[3],a;b[0]=a[0]+d[0];b[1]=a[1]+d[1];b[2]=a[2]+d[2];b[3]=a[3]+d[3];return b};m.multiply=function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2];a=a[3];var g=d[0],h=d[1],k=d[2];d=d[3];b[0]=c*d+a*g+e*k-f*h;b[1]=e*d+a*h+f*g-c*k;b[2]=f*d+a*k+c*h-e*g;b[3]=a*d-c*g-e*h-f*k;return b};m.multiplyVec3=function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=a[0];var g=a[1],h=a[2];a=a[3];var k=a*c+g*f-h*e,l=a*e+h*c-d*f,m=a*f+d*e-g*c,c=-d*c-g*e-h*f;b[0]=k*a+c*-d+l*-h-m*-g;b[1]=l*a+c*-g+m*-d-k*-h;b[2]=m*a+c*-h+k*-g-l*-d; +return b};m.scale=function(a,d,b){if(!b||a===b)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a;b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[3]=a[3]*d;return b};m.toMat3=function(a,d){d||(d=x.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b*k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=m-f;d[4]=1-(l+e);d[5]=c+g;d[6]=b+h;d[7]=c-g;d[8]=1-(l+p);return d};m.toMat4=function(a,d){d||(d=t.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b* +k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=0;d[4]=m-f;d[5]=1-(l+e);d[6]=c+g;d[7]=0;d[8]=b+h;d[9]=c-g;d[10]=1-(l+p);d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d};m.slerp=function(a,d,b,c){c||(c=a);var e=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3],f,g;if(1<=Math.abs(e))return c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]),c;f=Math.acos(e);g=Math.sqrt(1-e*e);if(0.0010>Math.abs(g))return c[0]=0.5*a[0]+0.5*d[0],c[1]=0.5*a[1]+0.5*d[1],c[2]=0.5*a[2]+0.5*d[2],c[3]=0.5*a[3]+ +0.5*d[3],c;e=Math.sin((1-b)*f)/g;b=Math.sin(b*f)/g;c[0]=a[0]*e+d[0]*b;c[1]=a[1]*e+d[1]*b;c[2]=a[2]*e+d[2]*b;c[3]=a[3]*e+d[3]*b;return c};m.fromRotationMatrix=function(a,d){d||(d=m.create());var b=a[0]+a[4]+a[8],c;if(0a[0]&&(b=1);a[8]>a[3*b+b]&&(b=2);var e=c[b],f=c[e];c=Math.sqrt(a[3*b+b]-a[3*e+e]-a[3*f+f]+1);d[b]=0.5*c;c= +0.5/c;d[3]=(a[3*f+e]-a[3*e+f])*c;d[e]=(a[3*e+b]+a[3*b+e])*c;d[f]=(a[3*f+b]+a[3*b+f])*c}return d};x.toQuat4=m.fromRotationMatrix;var B=x.create();m.fromAxes=function(a,d,b,c){B[0]=d[0];B[3]=d[1];B[6]=d[2];B[1]=b[0];B[4]=b[1];B[7]=b[2];B[2]=a[0];B[5]=a[1];B[8]=a[2];return m.fromRotationMatrix(B,c)};m.identity=function(a){a||(a=m.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};m.fromAngleAxis=function(a,d,b){b||(b=m.create());a*=0.5;var c=Math.sin(a);b[3]=Math.cos(a);b[0]=c*d[0];b[1]=c*d[1];b[2]=c*d[2]; +return b};m.toAngleAxis=function(a,d){d||(d=a);var b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); +b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 +Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],e=a[1],f=a[2],g=a[3],h=c*g-f*e;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-e*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, +b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];c[0]=e*b[0]+f*b[2];c[1]=e*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=e*b+f*h;c[1]=e*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var e=b[0];b=b[1];c[0]=e*a[0]+b*a[1];c[1]=e*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var e=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=e*b;c[2]=f*h;c[3]= +g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, +b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| +(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= +f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; +PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; +PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l>1);var b=m[0];return b*(1.5-0.5*a*b*b)}}else g.invsqrt=function(a){return 1/Math.sqrt(a)}; -var l=null;f();var j={create:function(a){var b=new l(3);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0;return b},createFrom:function(a,b,e){var c=new l(3);c[0]=a;c[1]=b;c[2]=e;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])},add:function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];return e},subtract:function(a, -b,e){if(!e||a===e)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];return e},multiply:function(a,b,e){if(!e||a===e)return a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a;e[0]=a[0]*b[0];e[1]=a[1]*b[1];e[2]=a[2]*b[2];return e},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;return e},normalize:function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=Math.sqrt(e* -e+c*c+d*d);if(!k)return b[0]=0,b[1]=0,b[2]=0,b;if(1===k)return b[0]=e,b[1]=c,b[2]=d,b;k=1/k;b[0]=e*k;b[1]=c*k;b[2]=d*k;return b},cross:function(a,b,e){e||(e=a);var c=a[0],d=a[1];a=a[2];var k=b[0],h=b[1];b=b[2];e[0]=d*b-a*h;e[1]=a*k-c*b;e[2]=c*h-d*k;return e},length:function(a){var b=a[0],e=a[1];a=a[2];return Math.sqrt(b*b+e*e+a*a)},squaredLength:function(a){var b=a[0],e=a[1];a=a[2];return b*b+e*e+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,b,e){e||(e=a);var c= -a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];b=Math.sqrt(c*c+d*d+a*a);if(!b)return e[0]=0,e[1]=0,e[2]=0,e;b=1/b;e[0]=c*b;e[1]=d*b;e[2]=a*b;return e},lerp:function(a,b,e,c){c||(c=a);c[0]=a[0]+e*(b[0]-a[0]);c[1]=a[1]+e*(b[1]-a[1]);c[2]=a[2]+e*(b[2]-a[2]);return c},dist:function(a,b){var e=b[0]-a[0],c=b[1]-a[1],d=b[2]-a[2];return Math.sqrt(e*e+c*c+d*d)}},x=null,n=new l(4);j.unproject=function(a,b,e,c,d){d||(d=a);x||(x=y.create());var k=x;n[0]=2*(a[0]-c[0])/c[2]-1;n[1]=2*(a[1]-c[1])/c[3]-1;n[2]=2*a[2]-1;n[3]=1; -y.multiply(e,b,k);if(!y.inverse(k))return null;y.multiplyVec4(k,n);if(0===n[3])return null;d[0]=n[0]/n[3];d[1]=n[1]/n[3];d[2]=n[2]/n[3];return d};var z=j.createFrom(1,0,0),A=j.createFrom(0,1,0),H=j.createFrom(0,0,1),C=j.create();j.rotationTo=function(a,b,e){e||(e=s.create());var c=j.dot(a,b);if(1<=c)s.set(O,e);else if(-0.999999>c)j.cross(z,a,C),1E-6>j.length(C)&&j.cross(A,a,C),1E-6>j.length(C)&&j.cross(H,a,C),j.normalize(C),s.fromAngleAxis(Math.PI,C,e);else{var c=Math.sqrt(2*(1+c)),d=1/c;j.cross(a, -b,C);e[0]=C[0]*d;e[1]=C[1]*d;e[2]=C[2]*d;e[3]=0.5*c;s.normalize(e)}1e[3]&&(e[3]=-1);return e};j.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var F={create:function(a){var b=new l(9);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0;return b},createFrom:function(a,b,e,c,d,k,h,E,K){var q=new l(9);q[0]=a;q[1]=b;q[2]=e;q[3]=c;q[4]=d;q[5]=k;q[6]=h;q[7]=E;q[8]=K;return q},determinant:function(a){var b= -a[3],e=a[4],c=a[5],d=a[6],k=a[7],h=a[8];return a[0]*(h*e-c*k)+a[1]*(-h*b+c*d)+a[2]*(k*b-e*d)},inverse:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],E=a[5],K=a[6],q=a[7],f=a[8],g=f*h-E*q,j=-f*k+E*K,J=q*k-h*K,r=e*g+c*j+d*J;if(!r)return null;r=1/r;b||(b=F.create());b[0]=g*r;b[1]=(-f*c+d*q)*r;b[2]=(E*c-d*h)*r;b[3]=j*r;b[4]=(f*e-d*K)*r;b[5]=(-E*e+d*k)*r;b[6]=J*r;b[7]=(-q*e+c*K)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],E=a[4],f=a[5],q=a[6],g= -a[7];a=a[8];var u=b[0],j=b[1],J=b[2],r=b[3],l=b[4],t=b[5],m=b[6],p=b[7];b=b[8];e[0]=u*c+j*h+J*q;e[1]=u*d+j*E+J*g;e[2]=u*k+j*f+J*a;e[3]=r*c+l*h+t*q;e[4]=r*d+l*E+t*g;e[5]=r*k+l*f+t*a;e[6]=m*c+p*h+b*q;e[7]=m*d+p*E+b*g;e[8]=m*k+p*f+b*a;return e},multiplyVec2:function(a,b,e){e||(e=b);var c=b[0];b=b[1];e[0]=c*a[0]+b*a[3]+a[6];e[1]=c*a[1]+b*a[4]+a[7];return e},multiplyVec3:function(a,b,e){e||(e=b);var c=b[0],d=b[1];b=b[2];e[0]=c*a[0]+d*a[3]+b*a[6];e[1]=c*a[1]+d*a[4]+b*a[7];e[2]=c*a[2]+d*a[5]+b*a[8];return e}, -set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])},identity:function(a){a||(a=F.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, -b){if(!b||a===b){var e=a[1],c=a[2],d=a[5];a[1]=a[3];a[2]=a[6];a[3]=e;a[5]=a[7];a[6]=c;a[7]=d;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]=a[8];return b},toMat4:function(a,b){b||(b=y.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ -a[8]+"]"}},y={create:function(a){var b=new l(16);a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]);return b},createFrom:function(a,b,e,c,d,k,h,E,f,q,g,u,j,J,r,m){var t=new l(16);t[0]=a;t[1]=b;t[2]=e;t[3]=c;t[4]=d;t[5]=k;t[6]=h;t[7]=E;t[8]=f;t[9]=q;t[10]=g;t[11]=u;t[12]=j;t[13]=J;t[14]=r;t[15]=m;return t},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4]; -b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])&&1E-6>Math.abs(a[9]-b[9])&&1E-6>Math.abs(a[10]-b[10])&&1E-6>Math.abs(a[11]-b[11])&&1E-6>Math.abs(a[12]- -b[12])&&1E-6>Math.abs(a[13]-b[13])&&1E-6>Math.abs(a[14]-b[14])&&1E-6>Math.abs(a[15]-b[15])},identity:function(a){a||(a=y.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){var e=a[1],c=a[2],d=a[3],k=a[6],h=a[7],E=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=e;a[6]=a[9];a[7]=a[13];a[8]=c;a[9]=k;a[11]=a[14];a[12]=d;a[13]=h;a[14]=E;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12]; -b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b=a[0],e=a[1],c=a[2],d=a[3],k=a[4],h=a[5],E=a[6],f=a[7],g=a[8],I=a[9],u=a[10],j=a[11],l=a[12],r=a[13],m=a[14];a=a[15];return l*I*E*d-g*r*E*d-l*h*u*d+k*r*u*d+g*h*m*d-k*I*m*d-l*I*c*f+g*r*c*f+l*e*u*f-b*r*u*f-g*e*m*f+b*I*m*f+l*h*c*j-k*r*c*j-l*e*E*j+b*r*E*j+k*e*m*j-b*h*m*j-g*h*c*a+k*I*c*a+g*e*E*a-b*I*E*a-k*e*u*a+b*h*u*a},inverse:function(a, -b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],f=a[5],g=a[6],q=a[7],I=a[8],u=a[9],j=a[10],l=a[11],r=a[12],m=a[13],t=a[14],p=a[15],s=e*f-c*h,n=e*g-d*h,v=e*q-k*h,w=c*g-d*f,x=c*q-k*f,y=d*q-k*g,z=I*m-u*r,A=I*t-j*r,C=I*p-l*r,D=u*t-j*m,F=u*p-l*m,H=j*p-l*t,G=s*H-n*F+v*D+w*C-x*A+y*z;if(!G)return null;G=1/G;b[0]=(f*H-g*F+q*D)*G;b[1]=(-c*H+d*F-k*D)*G;b[2]=(m*y-t*x+p*w)*G;b[3]=(-u*y+j*x-l*w)*G;b[4]=(-h*H+g*C-q*A)*G;b[5]=(e*H-d*C+k*A)*G;b[6]=(-r*y+t*v-p*n)*G;b[7]=(I*y-j*v+l*n)*G;b[8]=(h*F-f*C+q*z)*G;b[9]= -(-e*F+c*C-k*z)*G;b[10]=(r*x-m*v+p*s)*G;b[11]=(-I*x+u*v-l*s)*G;b[12]=(-h*D+f*A-g*z)*G;b[13]=(e*D-c*A+d*z)*G;b[14]=(-r*w+m*n-t*s)*G;b[15]=(I*w-u*n+j*s)*G;return b},toRotationMat:function(a,b){b||(b=y.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=F.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10]; -return b},toInverseMat3:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[4],h=a[5],f=a[6],g=a[8],q=a[9],j=a[10],u=j*h-f*q,l=-j*k+f*g,m=q*k-h*g,r=e*u+c*l+d*m;if(!r)return null;r=1/r;b||(b=F.create());b[0]=u*r;b[1]=(-j*c+d*q)*r;b[2]=(f*c-d*h)*r;b[3]=l*r;b[4]=(j*e-d*g)*r;b[5]=(-f*e+d*k)*r;b[6]=m*r;b[7]=(-q*e+c*g)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],f=a[4],g=a[5],q=a[6],j=a[7],u=a[8],l=a[9],m=a[10],r=a[11],p=a[12],t=a[13],s=a[14];a=a[15];var n=b[0], -B=b[1],v=b[2],w=b[3];e[0]=n*c+B*f+v*u+w*p;e[1]=n*d+B*g+v*l+w*t;e[2]=n*k+B*q+v*m+w*s;e[3]=n*h+B*j+v*r+w*a;n=b[4];B=b[5];v=b[6];w=b[7];e[4]=n*c+B*f+v*u+w*p;e[5]=n*d+B*g+v*l+w*t;e[6]=n*k+B*q+v*m+w*s;e[7]=n*h+B*j+v*r+w*a;n=b[8];B=b[9];v=b[10];w=b[11];e[8]=n*c+B*f+v*u+w*p;e[9]=n*d+B*g+v*l+w*t;e[10]=n*k+B*q+v*m+w*s;e[11]=n*h+B*j+v*r+w*a;n=b[12];B=b[13];v=b[14];w=b[15];e[12]=n*c+B*f+v*u+w*p;e[13]=n*d+B*g+v*l+w*t;e[14]=n*k+B*q+v*m+w*s;e[15]=n*h+B*j+v*r+w*a;return e},multiplyVec3:function(a,b,e){e||(e=b); -var c=b[0],d=b[1];b=b[2];e[0]=a[0]*c+a[4]*d+a[8]*b+a[12];e[1]=a[1]*c+a[5]*d+a[9]*b+a[13];e[2]=a[2]*c+a[6]*d+a[10]*b+a[14];return e},multiplyVec4:function(a,b,e){e||(e=b);var c=b[0],d=b[1],k=b[2];b=b[3];e[0]=a[0]*c+a[4]*d+a[8]*k+a[12]*b;e[1]=a[1]*c+a[5]*d+a[9]*k+a[13]*b;e[2]=a[2]*c+a[6]*d+a[10]*k+a[14]*b;e[3]=a[3]*c+a[7]*d+a[11]*k+a[15]*b;return e},translate:function(a,b,e){var c=b[0],d=b[1];b=b[2];var k,h,f,g,q,j,u,l,m,n,p,s;if(!e||a===e)return a[12]=a[0]*c+a[4]*d+a[8]*b+a[12],a[13]=a[1]*c+a[5]*d+ -a[9]*b+a[13],a[14]=a[2]*c+a[6]*d+a[10]*b+a[14],a[15]=a[3]*c+a[7]*d+a[11]*b+a[15],a;k=a[0];h=a[1];f=a[2];g=a[3];q=a[4];j=a[5];u=a[6];l=a[7];m=a[8];n=a[9];p=a[10];s=a[11];e[0]=k;e[1]=h;e[2]=f;e[3]=g;e[4]=q;e[5]=j;e[6]=u;e[7]=l;e[8]=m;e[9]=n;e[10]=p;e[11]=s;e[12]=k*c+q*d+m*b+a[12];e[13]=h*c+j*d+n*b+a[13];e[14]=f*c+u*d+p*b+a[14];e[15]=g*c+l*d+s*b+a[15];return e},scale:function(a,b,e){var c=b[0],d=b[1];b=b[2];if(!e||a===e)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=d,a[5]*=d,a[6]*=d,a[7]*=d,a[8]*=b,a[9]*= -b,a[10]*=b,a[11]*=b,a;e[0]=a[0]*c;e[1]=a[1]*c;e[2]=a[2]*c;e[3]=a[3]*c;e[4]=a[4]*d;e[5]=a[5]*d;e[6]=a[6]*d;e[7]=a[7]*d;e[8]=a[8]*b;e[9]=a[9]*b;e[10]=a[10]*b;e[11]=a[11]*b;e[12]=a[12];e[13]=a[13];e[14]=a[14];e[15]=a[15];return e},rotate:function(a,b,e,c){var d=e[0],k=e[1];e=e[2];var h=Math.sqrt(d*d+k*k+e*e),f,g,q,j,l,m,n,r,p,s,x,y,B,v,w,z,A,C,D,F;if(!h)return null;1!==h&&(h=1/h,d*=h,k*=h,e*=h);f=Math.sin(b);g=Math.cos(b);q=1-g;b=a[0];h=a[1];j=a[2];l=a[3];m=a[4];n=a[5];r=a[6];p=a[7];s=a[8];x=a[9];y= -a[10];B=a[11];v=d*d*q+g;w=k*d*q+e*f;z=e*d*q-k*f;A=d*k*q-e*f;C=k*k*q+g;D=e*k*q+d*f;F=d*e*q+k*f;d=k*e*q-d*f;k=e*e*q+g;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=b*v+m*w+s*z;c[1]=h*v+n*w+x*z;c[2]=j*v+r*w+y*z;c[3]=l*v+p*w+B*z;c[4]=b*A+m*C+s*D;c[5]=h*A+n*C+x*D;c[6]=j*A+r*C+y*D;c[7]=l*A+p*C+B*D;c[8]=b*F+m*d+s*k;c[9]=h*F+n*d+x*k;c[10]=j*F+r*d+y*k;c[11]=l*F+p*d+B*k;return c},rotateX:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[4],k=a[5],h=a[6],f=a[7],g=a[8],q=a[9],j=a[10], -l=a[11];e?a!==e&&(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[4]=d*b+g*c;e[5]=k*b+q*c;e[6]=h*b+j*c;e[7]=f*b+l*c;e[8]=d*-c+g*b;e[9]=k*-c+q*b;e[10]=h*-c+j*b;e[11]=f*-c+l*b;return e},rotateY:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[8],j=a[9],l=a[10],m=a[11];e?a!==e&&(e[4]=a[4],e[5]=a[5],e[6]=a[6],e[7]=a[7],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*-c;e[1]=k*b+j*-c;e[2]=h*b+l*-c;e[3]=f* -b+m*-c;e[8]=d*c+g*b;e[9]=k*c+j*b;e[10]=h*c+l*b;e[11]=f*c+m*b;return e},rotateZ:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[4],j=a[5],l=a[6],m=a[7];e?a!==e&&(e[8]=a[8],e[9]=a[9],e[10]=a[10],e[11]=a[11],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*c;e[1]=k*b+j*c;e[2]=h*b+l*c;e[3]=f*b+m*c;e[4]=d*-c+g*b;e[5]=k*-c+j*b;e[6]=h*-c+l*b;e[7]=f*-c+m*b;return e},frustum:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2*d/f;h[1]=0; -h[2]=0;h[3]=0;h[4]=0;h[5]=2*d/g;h[6]=0;h[7]=0;h[8]=(b+a)/f;h[9]=(c+e)/g;h[10]=-(k+d)/j;h[11]=-1;h[12]=0;h[13]=0;h[14]=-(2*k*d)/j;h[15]=0;return h},perspective:function(a,b,e,c,d){a=e*Math.tan(a*Math.PI/360);b*=a;return y.frustum(-b,b,-a,a,e,c,d)},ortho:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2/f;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/g;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/j;h[11]=0;h[12]=-(a+b)/f;h[13]=-(c+e)/g;h[14]=-(k+d)/j;h[15]=1;return h},lookAt:function(a,b,e,c){c|| -(c=y.create());var d,k,h,f,g,j,l,m,n=a[0],p=a[1];a=a[2];h=e[0];f=e[1];k=e[2];l=b[0];e=b[1];d=b[2];if(n===l&&p===e&&a===d)return y.identity(c);b=n-l;e=p-e;l=a-d;m=1/Math.sqrt(b*b+e*e+l*l);b*=m;e*=m;l*=m;d=f*l-k*e;k=k*b-h*l;h=h*e-f*b;(m=Math.sqrt(d*d+k*k+h*h))?(m=1/m,d*=m,k*=m,h*=m):h=k=d=0;f=e*h-l*k;g=l*d-b*h;j=b*k-e*d;(m=Math.sqrt(f*f+g*g+j*j))?(m=1/m,f*=m,g*=m,j*=m):j=g=f=0;c[0]=d;c[1]=f;c[2]=b;c[3]=0;c[4]=k;c[5]=g;c[6]=e;c[7]=0;c[8]=h;c[9]=j;c[10]=l;c[11]=0;c[12]=-(d*n+k*p+h*a);c[13]=-(f*n+g*p+ -j*a);c[14]=-(b*n+e*p+l*a);c[15]=1;return c},fromRotationTranslation:function(a,b,e){e||(e=y.create());var c=a[0],d=a[1],k=a[2],h=a[3],f=c+c,g=d+d,j=k+k;a=c*f;var l=c*g,c=c*j,m=d*g,d=d*j,k=k*j,f=h*f,g=h*g,h=h*j;e[0]=1-(m+k);e[1]=l+h;e[2]=c-g;e[3]=0;e[4]=l-h;e[5]=1-(a+k);e[6]=d+f;e[7]=0;e[8]=c+g;e[9]=d-f;e[10]=1-(a+m);e[11]=0;e[12]=b[0];e[13]=b[1];e[14]=b[2];e[15]=1;return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ -a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},s={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,e,c){var d=new l(4);d[0]=a;d[1]=b;d[2]=e;d[3]=c;return d},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=s.create()); -a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},O=s.identity();s.calculateW=function(a,b){var e=a[0],c=a[1],d=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d)),a;b[0]=e;b[1]=c;b[2]=d;b[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d));return b};s.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};s.inverse=function(a,b){var e=a[0],c=a[1],d=a[2],f=a[3],e=(e=e*e+c*c+d*d+f*f)?1/e:0;if(!b||a===b)return a[0]*=-e,a[1]*=-e,a[2]*=-e,a[3]*=e,a;b[0]=-a[0]*e;b[1]=-a[1]*e;b[2]=-a[2]*e;b[3]=a[3]*e; -return b};s.conjugate=function(a,b){if(!b||a===b)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};s.length=function(a){var b=a[0],e=a[1],c=a[2];a=a[3];return Math.sqrt(b*b+e*e+c*c+a*a)};s.normalize=function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],f=a[3],h=Math.sqrt(e*e+c*c+d*d+f*f);if(0===h)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;h=1/h;b[0]=e*h;b[1]=c*h;b[2]=d*h;b[3]=f*h;return b};s.add=function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+= -b[3],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];e[3]=a[3]+b[3];return e};s.multiply=function(a,b,e){e||(e=a);var c=a[0],d=a[1],f=a[2];a=a[3];var h=b[0],g=b[1],j=b[2];b=b[3];e[0]=c*b+a*h+d*j-f*g;e[1]=d*b+a*g+f*h-c*j;e[2]=f*b+a*j+c*g-d*h;e[3]=a*b-c*h-d*g-f*j;return e};s.multiplyVec3=function(a,b,e){e||(e=b);var c=b[0],d=b[1],f=b[2];b=a[0];var h=a[1],g=a[2];a=a[3];var j=a*c+h*f-g*d,l=a*d+g*c-b*f,m=a*f+b*d-h*c,c=-b*c-h*d-g*f;e[0]=j*a+c*-b+l*-g-m*-h;e[1]=l*a+c*-h+m*-b-j*-g;e[2]=m*a+c*-g+j*-h-l*-b; -return e};s.scale=function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a[3]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;e[3]=a[3]*b;return e};s.toMat3=function(a,b){b||(b=F.create());var e=a[0],c=a[1],d=a[2],f=a[3],h=e+e,g=c+c,j=d+d,l=e*h,m=e*g,e=e*j,n=c*g,c=c*j,d=d*j,h=f*h,g=f*g,f=f*j;b[0]=1-(n+d);b[1]=m+f;b[2]=e-g;b[3]=m-f;b[4]=1-(l+d);b[5]=c+h;b[6]=e+g;b[7]=c-h;b[8]=1-(l+n);return b};s.toMat4=function(a,b){b||(b=y.create());var e=a[0],c=a[1],d=a[2],f=a[3],g=e+e,j=c+c,l=d+d,m=e*g,n=e*j,e=e* -l,p=c*j,c=c*l,d=d*l,g=f*g,j=f*j,f=f*l;b[0]=1-(p+d);b[1]=n+f;b[2]=e-j;b[3]=0;b[4]=n-f;b[5]=1-(m+d);b[6]=c+g;b[7]=0;b[8]=e+j;b[9]=c-g;b[10]=1-(m+p);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};s.slerp=function(a,b,c,d){d||(d=a);var f=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],g,h;if(1<=Math.abs(f))return d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d;g=Math.acos(f);h=Math.sqrt(1-f*f);if(0.001>Math.abs(h))return d[0]=0.5*a[0]+0.5*b[0],d[1]=0.5*a[1]+0.5*b[1],d[2]=0.5*a[2]+0.5*b[2],d[3]=0.5*a[3]+ -0.5*b[3],d;f=Math.sin((1-c)*g)/h;c=Math.sin(c*g)/h;d[0]=a[0]*f+b[0]*c;d[1]=a[1]*f+b[1]*c;d[2]=a[2]*f+b[2]*c;d[3]=a[3]*f+b[3]*c;return d};s.fromRotationMatrix=function(a,b){b||(b=s.create());var c=a[0]+a[4]+a[8],d;if(0a[0]&&(c=1);a[8]>a[3*c+c]&&(c=2);var f=d[c],g=d[f];d=Math.sqrt(a[3*c+c]-a[3*f+f]-a[3*g+g]+1);b[c]=0.5*d;d= -0.5/d;b[3]=(a[3*g+f]-a[3*f+g])*d;b[f]=(a[3*f+c]+a[3*c+f])*d;b[g]=(a[3*g+c]+a[3*c+g])*d}return b};F.toQuat4=s.fromRotationMatrix;var D=F.create();s.fromAxes=function(a,b,c,d){D[0]=b[0];D[3]=b[1];D[6]=b[2];D[1]=c[0];D[4]=c[1];D[7]=c[2];D[2]=a[0];D[5]=a[1];D[8]=a[2];return s.fromRotationMatrix(D,d)};s.identity=function(a){a||(a=s.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};s.fromAngleAxis=function(a,b,c){c||(c=s.create());a*=0.5;var d=Math.sin(a);c[3]=Math.cos(a);c[0]=d*b[0];c[1]=d*b[1];c[2]=d*b[2]; -return c};s.toAngleAxis=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); -b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 -Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],f=a[2],g=a[3],h=c*g-f*d;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-d*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, -b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];c[0]=d*b[0]+f*b[2];c[1]=d*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=d*b+f*h;c[1]=d*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var d=b[0];b=b[1];c[0]=d*a[0]+b*a[1];c[1]=d*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var d=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=d*b;c[2]=f*h;c[3]= -g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,d){var f=new l(4);f[0]=a;f[1]=b;f[2]=c;f[3]=d;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, -b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| -(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)},squaredLength:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};c&&(c.glMatrixArrayType=l,c.MatrixArray=l,c.setMatrixArrayType=d,c.determineMatrixArrayType= -f,c.glMath=g,c.vec2=M,c.vec3=j,c.vec4=N,c.mat2=L,c.mat3=F,c.mat4=y,c.quat4=s);return{glMatrixArrayType:l,MatrixArray:l,setMatrixArrayType:d,determineMatrixArrayType:f,glMath:g,vec2:M,vec3:j,vec4:N,mat2:L,mat3:F,mat4:y,quat4:s}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * vColor;","}"]; -PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"]; -PIXI.CompileVertexShader=function(c,d){for(var f="",g=0;g>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/examples/bunny benchmark/index.html b/examples/bunny benchmark/index.html index 7c5521b..95972c4 100644 --- a/examples/bunny benchmark/index.html +++ b/examples/bunny benchmark/index.html @@ -9,9 +9,10 @@ +
    Click to add more bunnys! Let me know how many you get on screen here @doormat23
    - + diff --git a/examples/bunny benchmark/js/bunnyBenchMark.js b/examples/bunny benchmark/js/bunnyBenchMark.js index a3154eb..c3c8ec5 100644 --- a/examples/bunny benchmark/js/bunnyBenchMark.js +++ b/examples/bunny benchmark/js/bunnyBenchMark.js @@ -22,18 +22,13 @@ var count = 0; var container; +var detail; + function onReady() { - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() + detail = document.getElementById("pixi"); - if(webgl) - { - renderer = new PIXI.WebGLRenderer(); - } - else - { - renderer = new PIXI.CanvasRenderer(480, 320); - } + renderer = PIXI.autoDetectRenderer(); stage = new PIXI.Stage; @@ -46,7 +41,7 @@ stats.domElement.style.top = "0px"; requestAnimFrame(update); - wabbitTexture = new PIXI.Texture("wabbit.png") + wabbitTexture = new PIXI.Texture.fromImage("wabbit.png") counter = document.createElement("div"); counter.className = "counter"; @@ -55,7 +50,6 @@ count = startBunnyCount; counter.innerHTML = count + " BUNNIES"; - container = new PIXI.DisplayObjectContainer(); stage.addChild(container); @@ -114,7 +108,9 @@ minX = 0; maxY = height; minY = 0; - + + detail.style.left = width - 204 + "px"; + detail.style.top = height - 100 + "px"; renderer.resize(width, height); } @@ -126,17 +122,17 @@ { // add 10 at a time :) - for (var i = 0; i < 2; i++) + for (var i = 0; i < 10; i++) { - var bunny = new PIXI.Sprite(wabbitTexture, {x:0, y:0, width:26, height:37}); + var bunny = new PIXI.Sprite(wabbitTexture); bunny.speedX = Math.random() * 10; bunny.speedY = (Math.random() * 10) - 5; bunny.anchor.x = 0.5; bunny.anchor.y = 1; - bunny.alpha = 0.3 + Math.random() * 0.7; + //bunny.alpha = 0.3 + Math.random() * 0.7; bunnys.push(bunny); - bunny.rotation = Math.random() - 0.5; + //bunny.rotation = Math.random() - 0.5; container.addChild(bunny); count++; diff --git a/examples/bunny benchmark/js/pixi.js b/examples/bunny benchmark/js/pixi.js new file mode 100644 index 0000000..65add09 --- /dev/null +++ b/examples/bunny benchmark/js/pixi.js @@ -0,0 +1,110 @@ +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, +d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* +j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= +a[0]-d[0],c=a[1]-d[1];a=a[2]-d[2];d=Math.sqrt(b*b+c*c+a*a);if(!d)return j[0]=0,j[1]=0,j[2]=0,j;d=1/d;j[0]=b*d;j[1]=c*d;j[2]=a*d;return j},lerp:function(a,d,j,b){b||(b=a);b[0]=a[0]+j*(d[0]-a[0]);b[1]=a[1]+j*(d[1]-a[1]);b[2]=a[2]+j*(d[2]-a[2]);return b},dist:function(a,d){var j=d[0]-a[0],b=d[1]-a[1],c=d[2]-a[2];return Math.sqrt(j*j+b*b+c*c)}},p=null,q=new k(4);l.unproject=function(a,d,j,b,c){c||(c=a);p||(p=t.create());var e=p;q[0]=2*(a[0]-b[0])/b[2]-1;q[1]=2*(a[1]-b[1])/b[3]-1;q[2]=2*a[2]-1;q[3]=1; +t.multiply(j,d,e);if(!t.inverse(e))return null;t.multiplyVec4(e,q);if(0===q[3])return null;c[0]=q[0]/q[3];c[1]=q[1]/q[3];c[2]=q[2]/q[3];return c};var C=l.createFrom(1,0,0),F=l.createFrom(0,1,0),u=l.createFrom(0,0,1),w=l.create();l.rotationTo=function(a,d,j){j||(j=m.create());var b=l.dot(a,d);if(1<=b)m.set(H,j);else if(-0.999999>b)l.cross(C,a,w),1E-6>l.length(w)&&l.cross(F,a,w),1E-6>l.length(w)&&l.cross(u,a,w),l.normalize(w),m.fromAngleAxis(Math.PI,w,j);else{var b=Math.sqrt(2*(1+b)),c=1/b;l.cross(a, +d,w);j[0]=w[0]*c;j[1]=w[1]*c;j[2]=w[2]*c;j[3]=0.5*b;m.normalize(j)}1j[3]&&(j[3]=-1);return j};l.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var x={create:function(a){var d=new k(9);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8]):d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=0;return d},createFrom:function(a,d,j,b,c,e,n,f,E){var s=new k(9);s[0]=a;s[1]=d;s[2]=j;s[3]=b;s[4]=c;s[5]=e;s[6]=n;s[7]=f;s[8]=E;return s},determinant:function(a){var d= +a[3],j=a[4],b=a[5],c=a[6],e=a[7],n=a[8];return a[0]*(n*j-b*e)+a[1]*(-n*d+b*c)+a[2]*(e*d-j*c)},inverse:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[3],n=a[4],f=a[5],E=a[6],s=a[7],I=a[8],g=I*n-f*s,h=-I*e+f*E,k=s*e-n*E,r=j*g+b*h+c*k;if(!r)return null;r=1/r;d||(d=x.create());d[0]=g*r;d[1]=(-I*b+c*s)*r;d[2]=(f*b-c*n)*r;d[3]=h*r;d[4]=(I*j-c*E)*r;d[5]=(-f*j+c*e)*r;d[6]=k*r;d[7]=(-s*j+b*E)*r;d[8]=(n*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],D=a[4],E=a[5],s=a[6],I= +a[7];a=a[8];var g=d[0],h=d[1],k=d[2],r=d[3],m=d[4],l=d[5],q=d[6],v=d[7];d=d[8];j[0]=g*b+h*f+k*s;j[1]=g*c+h*D+k*I;j[2]=g*e+h*E+k*a;j[3]=r*b+m*f+l*s;j[4]=r*c+m*D+l*I;j[5]=r*e+m*E+l*a;j[6]=q*b+v*f+d*s;j[7]=q*c+v*D+d*I;j[8]=q*e+v*E+d*a;return j},multiplyVec2:function(a,d,j){j||(j=d);var b=d[0];d=d[1];j[0]=b*a[0]+d*a[3]+a[6];j[1]=b*a[1]+d*a[4]+a[7];return j},multiplyVec3:function(a,d,j){j||(j=d);var b=d[0],c=d[1];d=d[2];j[0]=b*a[0]+c*a[3]+d*a[6];j[1]=b*a[1]+c*a[4]+d*a[7];j[2]=b*a[2]+c*a[5]+d*a[8];return j}, +set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])},identity:function(a){a||(a=x.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, +d){if(!d||a===d){var j=a[1],b=a[2],c=a[5];a[1]=a[3];a[2]=a[6];a[3]=j;a[5]=a[7];a[6]=b;a[7]=c;return a}d[0]=a[0];d[1]=a[3];d[2]=a[6];d[3]=a[1];d[4]=a[4];d[5]=a[7];d[6]=a[2];d[7]=a[5];d[8]=a[8];return d},toMat4:function(a,d){d||(d=t.create());d[15]=1;d[14]=0;d[13]=0;d[12]=0;d[11]=0;d[10]=a[8];d[9]=a[7];d[8]=a[6];d[7]=0;d[6]=a[5];d[5]=a[4];d[4]=a[3];d[3]=0;d[2]=a[2];d[1]=a[1];d[0]=a[0];return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ +a[8]+"]"}},t={create:function(a){var d=new k(16);a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8],d[9]=a[9],d[10]=a[10],d[11]=a[11],d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d},createFrom:function(a,d,j,b,c,e,f,D,E,s,g,h,m,l,r,q){var A=new k(16);A[0]=a;A[1]=d;A[2]=j;A[3]=b;A[4]=c;A[5]=e;A[6]=f;A[7]=D;A[8]=E;A[9]=s;A[10]=g;A[11]=h;A[12]=m;A[13]=l;A[14]=r;A[15]=q;return A},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4]; +d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=a[12];d[13]=a[13];d[14]=a[14];d[15]=a[15];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])&&1E-6>Math.abs(a[9]-d[9])&&1E-6>Math.abs(a[10]-d[10])&&1E-6>Math.abs(a[11]-d[11])&&1E-6>Math.abs(a[12]- +d[12])&&1E-6>Math.abs(a[13]-d[13])&&1E-6>Math.abs(a[14]-d[14])&&1E-6>Math.abs(a[15]-d[15])},identity:function(a){a||(a=t.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,d){if(!d||a===d){var j=a[1],b=a[2],c=a[3],e=a[6],f=a[7],D=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=j;a[6]=a[9];a[7]=a[13];a[8]=b;a[9]=e;a[11]=a[14];a[12]=c;a[13]=f;a[14]=D;return a}d[0]=a[0];d[1]=a[4];d[2]=a[8];d[3]=a[12]; +d[4]=a[1];d[5]=a[5];d[6]=a[9];d[7]=a[13];d[8]=a[2];d[9]=a[6];d[10]=a[10];d[11]=a[14];d[12]=a[3];d[13]=a[7];d[14]=a[11];d[15]=a[15];return d},determinant:function(a){var d=a[0],j=a[1],b=a[2],c=a[3],e=a[4],f=a[5],D=a[6],E=a[7],s=a[8],g=a[9],h=a[10],k=a[11],m=a[12],r=a[13],l=a[14];a=a[15];return m*g*D*c-s*r*D*c-m*f*h*c+e*r*h*c+s*f*l*c-e*g*l*c-m*g*b*E+s*r*b*E+m*j*h*E-d*r*h*E-s*j*l*E+d*g*l*E+m*f*b*k-e*r*b*k-m*j*D*k+d*r*D*k+e*j*l*k-d*f*l*k-s*f*b*a+e*g*b*a+s*j*D*a-d*g*D*a-e*j*h*a+d*f*h*a},inverse:function(a, +d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=a[3],f=a[4],D=a[5],E=a[6],s=a[7],g=a[8],h=a[9],k=a[10],m=a[11],r=a[12],l=a[13],A=a[14],q=a[15],v=j*D-b*f,J=j*E-c*f,y=j*s-e*f,z=b*E-c*D,t=b*s-e*D,u=c*s-e*E,p=g*l-h*r,w=g*A-k*r,x=g*q-m*r,B=h*A-k*l,C=h*q-m*l,F=k*q-m*A,G=v*F-J*C+y*B+z*x-t*w+u*p;if(!G)return null;G=1/G;d[0]=(D*F-E*C+s*B)*G;d[1]=(-b*F+c*C-e*B)*G;d[2]=(l*u-A*t+q*z)*G;d[3]=(-h*u+k*t-m*z)*G;d[4]=(-f*F+E*x-s*w)*G;d[5]=(j*F-c*x+e*w)*G;d[6]=(-r*u+A*y-q*J)*G;d[7]=(g*u-k*y+m*J)*G;d[8]=(f*C-D*x+s*p)*G;d[9]= +(-j*C+b*x-e*p)*G;d[10]=(r*t-l*y+q*v)*G;d[11]=(-g*t+h*y-m*v)*G;d[12]=(-f*B+D*w-E*p)*G;d[13]=(j*B-b*w+c*p)*G;d[14]=(-r*z+l*J-A*v)*G;d[15]=(g*z-h*J+k*v)*G;return d},toRotationMat:function(a,d){d||(d=t.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d},toMat3:function(a,d){d||(d=x.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[4];d[4]=a[5];d[5]=a[6];d[6]=a[8];d[7]=a[9];d[8]=a[10]; +return d},toInverseMat3:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[4],f=a[5],D=a[6],g=a[8],s=a[9],h=a[10],k=h*f-D*s,m=-h*e+D*g,l=s*e-f*g,r=j*k+b*m+c*l;if(!r)return null;r=1/r;d||(d=x.create());d[0]=k*r;d[1]=(-h*b+c*s)*r;d[2]=(D*b-c*f)*r;d[3]=m*r;d[4]=(h*j-c*g)*r;d[5]=(-D*j+c*e)*r;d[6]=l*r;d[7]=(-s*j+b*g)*r;d[8]=(f*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],s=a[6],k=a[7],m=a[8],l=a[9],q=a[10],r=a[11],t=a[12],A=a[13],u=a[14];a=a[15];var v=d[0], +p=d[1],y=d[2],z=d[3];j[0]=v*b+p*g+y*m+z*t;j[1]=v*c+p*h+y*l+z*A;j[2]=v*e+p*s+y*q+z*u;j[3]=v*f+p*k+y*r+z*a;v=d[4];p=d[5];y=d[6];z=d[7];j[4]=v*b+p*g+y*m+z*t;j[5]=v*c+p*h+y*l+z*A;j[6]=v*e+p*s+y*q+z*u;j[7]=v*f+p*k+y*r+z*a;v=d[8];p=d[9];y=d[10];z=d[11];j[8]=v*b+p*g+y*m+z*t;j[9]=v*c+p*h+y*l+z*A;j[10]=v*e+p*s+y*q+z*u;j[11]=v*f+p*k+y*r+z*a;v=d[12];p=d[13];y=d[14];z=d[15];j[12]=v*b+p*g+y*m+z*t;j[13]=v*c+p*h+y*l+z*A;j[14]=v*e+p*s+y*q+z*u;j[15]=v*f+p*k+y*r+z*a;return j},multiplyVec3:function(a,d,b){b||(b=d); +var c=d[0],e=d[1];d=d[2];b[0]=a[0]*c+a[4]*e+a[8]*d+a[12];b[1]=a[1]*c+a[5]*e+a[9]*d+a[13];b[2]=a[2]*c+a[6]*e+a[10]*d+a[14];return b},multiplyVec4:function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=d[3];b[0]=a[0]*c+a[4]*e+a[8]*f+a[12]*d;b[1]=a[1]*c+a[5]*e+a[9]*f+a[13]*d;b[2]=a[2]*c+a[6]*e+a[10]*f+a[14]*d;b[3]=a[3]*c+a[7]*e+a[11]*f+a[15]*d;return b},translate:function(a,d,b){var c=d[0],e=d[1];d=d[2];var f,n,g,h,s,k,m,l,p,r,q,t;if(!b||a===b)return a[12]=a[0]*c+a[4]*e+a[8]*d+a[12],a[13]=a[1]*c+a[5]*e+ +a[9]*d+a[13],a[14]=a[2]*c+a[6]*e+a[10]*d+a[14],a[15]=a[3]*c+a[7]*e+a[11]*d+a[15],a;f=a[0];n=a[1];g=a[2];h=a[3];s=a[4];k=a[5];m=a[6];l=a[7];p=a[8];r=a[9];q=a[10];t=a[11];b[0]=f;b[1]=n;b[2]=g;b[3]=h;b[4]=s;b[5]=k;b[6]=m;b[7]=l;b[8]=p;b[9]=r;b[10]=q;b[11]=t;b[12]=f*c+s*e+p*d+a[12];b[13]=n*c+k*e+r*d+a[13];b[14]=g*c+m*e+q*d+a[14];b[15]=h*c+l*e+t*d+a[15];return b},scale:function(a,d,b){var c=d[0],e=d[1];d=d[2];if(!b||a===b)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=d,a[9]*= +d,a[10]*=d,a[11]*=d,a;b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[7]=a[7]*e;b[8]=a[8]*d;b[9]=a[9]*d;b[10]=a[10]*d;b[11]=a[11]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},rotate:function(a,d,b,c){var e=b[0],f=b[1];b=b[2];var n=Math.sqrt(e*e+f*f+b*b),g,h,k,m,l,p,q,r,t,u,w,v,x,y,z,B,C,F,H,K;if(!n)return null;1!==n&&(n=1/n,e*=n,f*=n,b*=n);g=Math.sin(d);h=Math.cos(d);k=1-h;d=a[0];n=a[1];m=a[2];l=a[3];p=a[4];q=a[5];r=a[6];t=a[7];u=a[8];w=a[9];v= +a[10];x=a[11];y=e*e*k+h;z=f*e*k+b*g;B=b*e*k-f*g;C=e*f*k-b*g;F=f*f*k+h;H=b*f*k+e*g;K=e*b*k+f*g;e=f*b*k-e*g;f=b*b*k+h;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=d*y+p*z+u*B;c[1]=n*y+q*z+w*B;c[2]=m*y+r*z+v*B;c[3]=l*y+t*z+x*B;c[4]=d*C+p*F+u*H;c[5]=n*C+q*F+w*H;c[6]=m*C+r*F+v*H;c[7]=l*C+t*F+x*H;c[8]=d*K+p*e+u*f;c[9]=n*K+q*e+w*f;c[10]=m*K+r*e+v*f;c[11]=l*K+t*e+x*f;return c},rotateX:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[4],f=a[5],n=a[6],g=a[7],h=a[8],k=a[9],m=a[10], +l=a[11];b?a!==b&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[4]=e*d+h*c;b[5]=f*d+k*c;b[6]=n*d+m*c;b[7]=g*d+l*c;b[8]=e*-c+h*d;b[9]=f*-c+k*d;b[10]=n*-c+m*d;b[11]=g*-c+l*d;return b},rotateY:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[8],k=a[9],m=a[10],l=a[11];b?a!==b&&(b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*-c;b[1]=f*d+k*-c;b[2]=n*d+m*-c;b[3]=g* +d+l*-c;b[8]=e*c+h*d;b[9]=f*c+k*d;b[10]=n*c+m*d;b[11]=g*c+l*d;return b},rotateZ:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[4],k=a[5],m=a[6],l=a[7];b?a!==b&&(b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*c;b[1]=f*d+k*c;b[2]=n*d+m*c;b[3]=g*d+l*c;b[4]=e*-c+h*d;b[5]=f*-c+k*d;b[6]=n*-c+m*d;b[7]=g*-c+l*d;return b},frustum:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2*e/g;n[1]=0; +n[2]=0;n[3]=0;n[4]=0;n[5]=2*e/h;n[6]=0;n[7]=0;n[8]=(d+a)/g;n[9]=(c+b)/h;n[10]=-(f+e)/k;n[11]=-1;n[12]=0;n[13]=0;n[14]=-(2*f*e)/k;n[15]=0;return n},perspective:function(a,d,b,c,e){a=b*Math.tan(a*Math.PI/360);d*=a;return t.frustum(-d,d,-a,a,b,c,e)},ortho:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2/g;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=2/h;n[6]=0;n[7]=0;n[8]=0;n[9]=0;n[10]=-2/k;n[11]=0;n[12]=-(a+d)/g;n[13]=-(c+b)/h;n[14]=-(f+e)/k;n[15]=1;return n},lookAt:function(a,d,b,c){c|| +(c=t.create());var e,f,n,g,h,k,m,l,p=a[0],q=a[1];a=a[2];n=b[0];g=b[1];f=b[2];m=d[0];b=d[1];e=d[2];if(p===m&&q===b&&a===e)return t.identity(c);d=p-m;b=q-b;m=a-e;l=1/Math.sqrt(d*d+b*b+m*m);d*=l;b*=l;m*=l;e=g*m-f*b;f=f*d-n*m;n=n*b-g*d;(l=Math.sqrt(e*e+f*f+n*n))?(l=1/l,e*=l,f*=l,n*=l):n=f=e=0;g=b*n-m*f;h=m*e-d*n;k=d*f-b*e;(l=Math.sqrt(g*g+h*h+k*k))?(l=1/l,g*=l,h*=l,k*=l):k=h=g=0;c[0]=e;c[1]=g;c[2]=d;c[3]=0;c[4]=f;c[5]=h;c[6]=b;c[7]=0;c[8]=n;c[9]=k;c[10]=m;c[11]=0;c[12]=-(e*p+f*q+n*a);c[13]=-(g*p+h*q+ +k*a);c[14]=-(d*p+b*q+m*a);c[15]=1;return c},fromRotationTranslation:function(a,d,b){b||(b=t.create());var c=a[0],e=a[1],f=a[2],n=a[3],g=c+c,h=e+e,k=f+f;a=c*g;var l=c*h,c=c*k,m=e*h,e=e*k,f=f*k,g=n*g,h=n*h,n=n*k;b[0]=1-(m+f);b[1]=l+n;b[2]=c-h;b[3]=0;b[4]=l-n;b[5]=1-(a+f);b[6]=e+g;b[7]=0;b[8]=c+h;b[9]=e-g;b[10]=1-(a+m);b[11]=0;b[12]=d[0];b[13]=d[1];b[14]=d[2];b[15]=1;return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ +a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},m={create:function(a){var d=new k(4);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]):d[0]=d[1]=d[2]=d[3]=0;return d},createFrom:function(a,d,b,c){var e=new k(4);e[0]=a;e[1]=d;e[2]=b;e[3]=c;return e},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])},identity:function(a){a||(a=m.create()); +a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},H=m.identity();m.calculateW=function(a,d){var b=a[0],c=a[1],e=a[2];if(!d||a===d)return a[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e)),a;d[0]=b;d[1]=c;d[2]=e;d[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e));return d};m.dot=function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3]};m.inverse=function(a,d){var b=a[0],c=a[1],e=a[2],f=a[3],b=(b=b*b+c*c+e*e+f*f)?1/b:0;if(!d||a===d)return a[0]*=-b,a[1]*=-b,a[2]*=-b,a[3]*=b,a;d[0]=-a[0]*b;d[1]=-a[1]*b;d[2]=-a[2]*b;d[3]=a[3]*b; +return d};m.conjugate=function(a,d){if(!d||a===d)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=a[3];return d};m.length=function(a){var d=a[0],b=a[1],c=a[2];a=a[3];return Math.sqrt(d*d+b*b+c*c+a*a)};m.normalize=function(a,d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=Math.sqrt(b*b+c*c+e*e+f*f);if(0===g)return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d;g=1/g;d[0]=b*g;d[1]=c*g;d[2]=e*g;d[3]=f*g;return d};m.add=function(a,d,b){if(!b||a===b)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a[3]+= +d[3],a;b[0]=a[0]+d[0];b[1]=a[1]+d[1];b[2]=a[2]+d[2];b[3]=a[3]+d[3];return b};m.multiply=function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2];a=a[3];var g=d[0],h=d[1],k=d[2];d=d[3];b[0]=c*d+a*g+e*k-f*h;b[1]=e*d+a*h+f*g-c*k;b[2]=f*d+a*k+c*h-e*g;b[3]=a*d-c*g-e*h-f*k;return b};m.multiplyVec3=function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=a[0];var g=a[1],h=a[2];a=a[3];var k=a*c+g*f-h*e,l=a*e+h*c-d*f,m=a*f+d*e-g*c,c=-d*c-g*e-h*f;b[0]=k*a+c*-d+l*-h-m*-g;b[1]=l*a+c*-g+m*-d-k*-h;b[2]=m*a+c*-h+k*-g-l*-d; +return b};m.scale=function(a,d,b){if(!b||a===b)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a;b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[3]=a[3]*d;return b};m.toMat3=function(a,d){d||(d=x.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b*k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=m-f;d[4]=1-(l+e);d[5]=c+g;d[6]=b+h;d[7]=c-g;d[8]=1-(l+p);return d};m.toMat4=function(a,d){d||(d=t.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b* +k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=0;d[4]=m-f;d[5]=1-(l+e);d[6]=c+g;d[7]=0;d[8]=b+h;d[9]=c-g;d[10]=1-(l+p);d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d};m.slerp=function(a,d,b,c){c||(c=a);var e=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3],f,g;if(1<=Math.abs(e))return c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]),c;f=Math.acos(e);g=Math.sqrt(1-e*e);if(0.0010>Math.abs(g))return c[0]=0.5*a[0]+0.5*d[0],c[1]=0.5*a[1]+0.5*d[1],c[2]=0.5*a[2]+0.5*d[2],c[3]=0.5*a[3]+ +0.5*d[3],c;e=Math.sin((1-b)*f)/g;b=Math.sin(b*f)/g;c[0]=a[0]*e+d[0]*b;c[1]=a[1]*e+d[1]*b;c[2]=a[2]*e+d[2]*b;c[3]=a[3]*e+d[3]*b;return c};m.fromRotationMatrix=function(a,d){d||(d=m.create());var b=a[0]+a[4]+a[8],c;if(0a[0]&&(b=1);a[8]>a[3*b+b]&&(b=2);var e=c[b],f=c[e];c=Math.sqrt(a[3*b+b]-a[3*e+e]-a[3*f+f]+1);d[b]=0.5*c;c= +0.5/c;d[3]=(a[3*f+e]-a[3*e+f])*c;d[e]=(a[3*e+b]+a[3*b+e])*c;d[f]=(a[3*f+b]+a[3*b+f])*c}return d};x.toQuat4=m.fromRotationMatrix;var B=x.create();m.fromAxes=function(a,d,b,c){B[0]=d[0];B[3]=d[1];B[6]=d[2];B[1]=b[0];B[4]=b[1];B[7]=b[2];B[2]=a[0];B[5]=a[1];B[8]=a[2];return m.fromRotationMatrix(B,c)};m.identity=function(a){a||(a=m.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};m.fromAngleAxis=function(a,d,b){b||(b=m.create());a*=0.5;var c=Math.sin(a);b[3]=Math.cos(a);b[0]=c*d[0];b[1]=c*d[1];b[2]=c*d[2]; +return b};m.toAngleAxis=function(a,d){d||(d=a);var b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); +b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 +Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],e=a[1],f=a[2],g=a[3],h=c*g-f*e;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-e*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, +b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];c[0]=e*b[0]+f*b[2];c[1]=e*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=e*b+f*h;c[1]=e*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var e=b[0];b=b[1];c[0]=e*a[0]+b*a[1];c[1]=e*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var e=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=e*b;c[2]=f*h;c[3]= +g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, +b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| +(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= +f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; +PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; +PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l>1);var b=m[0];return b*(1.5-0.5*a*b*b)}}else g.invsqrt=function(a){return 1/Math.sqrt(a)}; -var l=null;f();var j={create:function(a){var b=new l(3);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0;return b},createFrom:function(a,b,e){var c=new l(3);c[0]=a;c[1]=b;c[2]=e;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])},add:function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];return e},subtract:function(a, -b,e){if(!e||a===e)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];return e},multiply:function(a,b,e){if(!e||a===e)return a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a;e[0]=a[0]*b[0];e[1]=a[1]*b[1];e[2]=a[2]*b[2];return e},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;return e},normalize:function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=Math.sqrt(e* -e+c*c+d*d);if(!k)return b[0]=0,b[1]=0,b[2]=0,b;if(1===k)return b[0]=e,b[1]=c,b[2]=d,b;k=1/k;b[0]=e*k;b[1]=c*k;b[2]=d*k;return b},cross:function(a,b,e){e||(e=a);var c=a[0],d=a[1];a=a[2];var k=b[0],h=b[1];b=b[2];e[0]=d*b-a*h;e[1]=a*k-c*b;e[2]=c*h-d*k;return e},length:function(a){var b=a[0],e=a[1];a=a[2];return Math.sqrt(b*b+e*e+a*a)},squaredLength:function(a){var b=a[0],e=a[1];a=a[2];return b*b+e*e+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,b,e){e||(e=a);var c= -a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];b=Math.sqrt(c*c+d*d+a*a);if(!b)return e[0]=0,e[1]=0,e[2]=0,e;b=1/b;e[0]=c*b;e[1]=d*b;e[2]=a*b;return e},lerp:function(a,b,e,c){c||(c=a);c[0]=a[0]+e*(b[0]-a[0]);c[1]=a[1]+e*(b[1]-a[1]);c[2]=a[2]+e*(b[2]-a[2]);return c},dist:function(a,b){var e=b[0]-a[0],c=b[1]-a[1],d=b[2]-a[2];return Math.sqrt(e*e+c*c+d*d)}},x=null,n=new l(4);j.unproject=function(a,b,e,c,d){d||(d=a);x||(x=y.create());var k=x;n[0]=2*(a[0]-c[0])/c[2]-1;n[1]=2*(a[1]-c[1])/c[3]-1;n[2]=2*a[2]-1;n[3]=1; -y.multiply(e,b,k);if(!y.inverse(k))return null;y.multiplyVec4(k,n);if(0===n[3])return null;d[0]=n[0]/n[3];d[1]=n[1]/n[3];d[2]=n[2]/n[3];return d};var z=j.createFrom(1,0,0),A=j.createFrom(0,1,0),H=j.createFrom(0,0,1),C=j.create();j.rotationTo=function(a,b,e){e||(e=s.create());var c=j.dot(a,b);if(1<=c)s.set(O,e);else if(-0.999999>c)j.cross(z,a,C),1E-6>j.length(C)&&j.cross(A,a,C),1E-6>j.length(C)&&j.cross(H,a,C),j.normalize(C),s.fromAngleAxis(Math.PI,C,e);else{var c=Math.sqrt(2*(1+c)),d=1/c;j.cross(a, -b,C);e[0]=C[0]*d;e[1]=C[1]*d;e[2]=C[2]*d;e[3]=0.5*c;s.normalize(e)}1e[3]&&(e[3]=-1);return e};j.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var F={create:function(a){var b=new l(9);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0;return b},createFrom:function(a,b,e,c,d,k,h,E,K){var q=new l(9);q[0]=a;q[1]=b;q[2]=e;q[3]=c;q[4]=d;q[5]=k;q[6]=h;q[7]=E;q[8]=K;return q},determinant:function(a){var b= -a[3],e=a[4],c=a[5],d=a[6],k=a[7],h=a[8];return a[0]*(h*e-c*k)+a[1]*(-h*b+c*d)+a[2]*(k*b-e*d)},inverse:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],E=a[5],K=a[6],q=a[7],f=a[8],g=f*h-E*q,j=-f*k+E*K,J=q*k-h*K,r=e*g+c*j+d*J;if(!r)return null;r=1/r;b||(b=F.create());b[0]=g*r;b[1]=(-f*c+d*q)*r;b[2]=(E*c-d*h)*r;b[3]=j*r;b[4]=(f*e-d*K)*r;b[5]=(-E*e+d*k)*r;b[6]=J*r;b[7]=(-q*e+c*K)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],E=a[4],f=a[5],q=a[6],g= -a[7];a=a[8];var u=b[0],j=b[1],J=b[2],r=b[3],l=b[4],t=b[5],m=b[6],p=b[7];b=b[8];e[0]=u*c+j*h+J*q;e[1]=u*d+j*E+J*g;e[2]=u*k+j*f+J*a;e[3]=r*c+l*h+t*q;e[4]=r*d+l*E+t*g;e[5]=r*k+l*f+t*a;e[6]=m*c+p*h+b*q;e[7]=m*d+p*E+b*g;e[8]=m*k+p*f+b*a;return e},multiplyVec2:function(a,b,e){e||(e=b);var c=b[0];b=b[1];e[0]=c*a[0]+b*a[3]+a[6];e[1]=c*a[1]+b*a[4]+a[7];return e},multiplyVec3:function(a,b,e){e||(e=b);var c=b[0],d=b[1];b=b[2];e[0]=c*a[0]+d*a[3]+b*a[6];e[1]=c*a[1]+d*a[4]+b*a[7];e[2]=c*a[2]+d*a[5]+b*a[8];return e}, -set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])},identity:function(a){a||(a=F.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, -b){if(!b||a===b){var e=a[1],c=a[2],d=a[5];a[1]=a[3];a[2]=a[6];a[3]=e;a[5]=a[7];a[6]=c;a[7]=d;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]=a[8];return b},toMat4:function(a,b){b||(b=y.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ -a[8]+"]"}},y={create:function(a){var b=new l(16);a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]);return b},createFrom:function(a,b,e,c,d,k,h,E,f,q,g,u,j,J,r,m){var t=new l(16);t[0]=a;t[1]=b;t[2]=e;t[3]=c;t[4]=d;t[5]=k;t[6]=h;t[7]=E;t[8]=f;t[9]=q;t[10]=g;t[11]=u;t[12]=j;t[13]=J;t[14]=r;t[15]=m;return t},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4]; -b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])&&1E-6>Math.abs(a[9]-b[9])&&1E-6>Math.abs(a[10]-b[10])&&1E-6>Math.abs(a[11]-b[11])&&1E-6>Math.abs(a[12]- -b[12])&&1E-6>Math.abs(a[13]-b[13])&&1E-6>Math.abs(a[14]-b[14])&&1E-6>Math.abs(a[15]-b[15])},identity:function(a){a||(a=y.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){var e=a[1],c=a[2],d=a[3],k=a[6],h=a[7],E=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=e;a[6]=a[9];a[7]=a[13];a[8]=c;a[9]=k;a[11]=a[14];a[12]=d;a[13]=h;a[14]=E;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12]; -b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b=a[0],e=a[1],c=a[2],d=a[3],k=a[4],h=a[5],E=a[6],f=a[7],g=a[8],I=a[9],u=a[10],j=a[11],l=a[12],r=a[13],m=a[14];a=a[15];return l*I*E*d-g*r*E*d-l*h*u*d+k*r*u*d+g*h*m*d-k*I*m*d-l*I*c*f+g*r*c*f+l*e*u*f-b*r*u*f-g*e*m*f+b*I*m*f+l*h*c*j-k*r*c*j-l*e*E*j+b*r*E*j+k*e*m*j-b*h*m*j-g*h*c*a+k*I*c*a+g*e*E*a-b*I*E*a-k*e*u*a+b*h*u*a},inverse:function(a, -b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],f=a[5],g=a[6],q=a[7],I=a[8],u=a[9],j=a[10],l=a[11],r=a[12],m=a[13],t=a[14],p=a[15],s=e*f-c*h,n=e*g-d*h,v=e*q-k*h,w=c*g-d*f,x=c*q-k*f,y=d*q-k*g,z=I*m-u*r,A=I*t-j*r,C=I*p-l*r,D=u*t-j*m,F=u*p-l*m,H=j*p-l*t,G=s*H-n*F+v*D+w*C-x*A+y*z;if(!G)return null;G=1/G;b[0]=(f*H-g*F+q*D)*G;b[1]=(-c*H+d*F-k*D)*G;b[2]=(m*y-t*x+p*w)*G;b[3]=(-u*y+j*x-l*w)*G;b[4]=(-h*H+g*C-q*A)*G;b[5]=(e*H-d*C+k*A)*G;b[6]=(-r*y+t*v-p*n)*G;b[7]=(I*y-j*v+l*n)*G;b[8]=(h*F-f*C+q*z)*G;b[9]= -(-e*F+c*C-k*z)*G;b[10]=(r*x-m*v+p*s)*G;b[11]=(-I*x+u*v-l*s)*G;b[12]=(-h*D+f*A-g*z)*G;b[13]=(e*D-c*A+d*z)*G;b[14]=(-r*w+m*n-t*s)*G;b[15]=(I*w-u*n+j*s)*G;return b},toRotationMat:function(a,b){b||(b=y.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=F.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10]; -return b},toInverseMat3:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[4],h=a[5],f=a[6],g=a[8],q=a[9],j=a[10],u=j*h-f*q,l=-j*k+f*g,m=q*k-h*g,r=e*u+c*l+d*m;if(!r)return null;r=1/r;b||(b=F.create());b[0]=u*r;b[1]=(-j*c+d*q)*r;b[2]=(f*c-d*h)*r;b[3]=l*r;b[4]=(j*e-d*g)*r;b[5]=(-f*e+d*k)*r;b[6]=m*r;b[7]=(-q*e+c*g)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],f=a[4],g=a[5],q=a[6],j=a[7],u=a[8],l=a[9],m=a[10],r=a[11],p=a[12],t=a[13],s=a[14];a=a[15];var n=b[0], -B=b[1],v=b[2],w=b[3];e[0]=n*c+B*f+v*u+w*p;e[1]=n*d+B*g+v*l+w*t;e[2]=n*k+B*q+v*m+w*s;e[3]=n*h+B*j+v*r+w*a;n=b[4];B=b[5];v=b[6];w=b[7];e[4]=n*c+B*f+v*u+w*p;e[5]=n*d+B*g+v*l+w*t;e[6]=n*k+B*q+v*m+w*s;e[7]=n*h+B*j+v*r+w*a;n=b[8];B=b[9];v=b[10];w=b[11];e[8]=n*c+B*f+v*u+w*p;e[9]=n*d+B*g+v*l+w*t;e[10]=n*k+B*q+v*m+w*s;e[11]=n*h+B*j+v*r+w*a;n=b[12];B=b[13];v=b[14];w=b[15];e[12]=n*c+B*f+v*u+w*p;e[13]=n*d+B*g+v*l+w*t;e[14]=n*k+B*q+v*m+w*s;e[15]=n*h+B*j+v*r+w*a;return e},multiplyVec3:function(a,b,e){e||(e=b); -var c=b[0],d=b[1];b=b[2];e[0]=a[0]*c+a[4]*d+a[8]*b+a[12];e[1]=a[1]*c+a[5]*d+a[9]*b+a[13];e[2]=a[2]*c+a[6]*d+a[10]*b+a[14];return e},multiplyVec4:function(a,b,e){e||(e=b);var c=b[0],d=b[1],k=b[2];b=b[3];e[0]=a[0]*c+a[4]*d+a[8]*k+a[12]*b;e[1]=a[1]*c+a[5]*d+a[9]*k+a[13]*b;e[2]=a[2]*c+a[6]*d+a[10]*k+a[14]*b;e[3]=a[3]*c+a[7]*d+a[11]*k+a[15]*b;return e},translate:function(a,b,e){var c=b[0],d=b[1];b=b[2];var k,h,f,g,q,j,u,l,m,n,p,s;if(!e||a===e)return a[12]=a[0]*c+a[4]*d+a[8]*b+a[12],a[13]=a[1]*c+a[5]*d+ -a[9]*b+a[13],a[14]=a[2]*c+a[6]*d+a[10]*b+a[14],a[15]=a[3]*c+a[7]*d+a[11]*b+a[15],a;k=a[0];h=a[1];f=a[2];g=a[3];q=a[4];j=a[5];u=a[6];l=a[7];m=a[8];n=a[9];p=a[10];s=a[11];e[0]=k;e[1]=h;e[2]=f;e[3]=g;e[4]=q;e[5]=j;e[6]=u;e[7]=l;e[8]=m;e[9]=n;e[10]=p;e[11]=s;e[12]=k*c+q*d+m*b+a[12];e[13]=h*c+j*d+n*b+a[13];e[14]=f*c+u*d+p*b+a[14];e[15]=g*c+l*d+s*b+a[15];return e},scale:function(a,b,e){var c=b[0],d=b[1];b=b[2];if(!e||a===e)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=d,a[5]*=d,a[6]*=d,a[7]*=d,a[8]*=b,a[9]*= -b,a[10]*=b,a[11]*=b,a;e[0]=a[0]*c;e[1]=a[1]*c;e[2]=a[2]*c;e[3]=a[3]*c;e[4]=a[4]*d;e[5]=a[5]*d;e[6]=a[6]*d;e[7]=a[7]*d;e[8]=a[8]*b;e[9]=a[9]*b;e[10]=a[10]*b;e[11]=a[11]*b;e[12]=a[12];e[13]=a[13];e[14]=a[14];e[15]=a[15];return e},rotate:function(a,b,e,c){var d=e[0],k=e[1];e=e[2];var h=Math.sqrt(d*d+k*k+e*e),f,g,q,j,l,m,n,r,p,s,x,y,B,v,w,z,A,C,D,F;if(!h)return null;1!==h&&(h=1/h,d*=h,k*=h,e*=h);f=Math.sin(b);g=Math.cos(b);q=1-g;b=a[0];h=a[1];j=a[2];l=a[3];m=a[4];n=a[5];r=a[6];p=a[7];s=a[8];x=a[9];y= -a[10];B=a[11];v=d*d*q+g;w=k*d*q+e*f;z=e*d*q-k*f;A=d*k*q-e*f;C=k*k*q+g;D=e*k*q+d*f;F=d*e*q+k*f;d=k*e*q-d*f;k=e*e*q+g;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=b*v+m*w+s*z;c[1]=h*v+n*w+x*z;c[2]=j*v+r*w+y*z;c[3]=l*v+p*w+B*z;c[4]=b*A+m*C+s*D;c[5]=h*A+n*C+x*D;c[6]=j*A+r*C+y*D;c[7]=l*A+p*C+B*D;c[8]=b*F+m*d+s*k;c[9]=h*F+n*d+x*k;c[10]=j*F+r*d+y*k;c[11]=l*F+p*d+B*k;return c},rotateX:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[4],k=a[5],h=a[6],f=a[7],g=a[8],q=a[9],j=a[10], -l=a[11];e?a!==e&&(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[4]=d*b+g*c;e[5]=k*b+q*c;e[6]=h*b+j*c;e[7]=f*b+l*c;e[8]=d*-c+g*b;e[9]=k*-c+q*b;e[10]=h*-c+j*b;e[11]=f*-c+l*b;return e},rotateY:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[8],j=a[9],l=a[10],m=a[11];e?a!==e&&(e[4]=a[4],e[5]=a[5],e[6]=a[6],e[7]=a[7],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*-c;e[1]=k*b+j*-c;e[2]=h*b+l*-c;e[3]=f* -b+m*-c;e[8]=d*c+g*b;e[9]=k*c+j*b;e[10]=h*c+l*b;e[11]=f*c+m*b;return e},rotateZ:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[4],j=a[5],l=a[6],m=a[7];e?a!==e&&(e[8]=a[8],e[9]=a[9],e[10]=a[10],e[11]=a[11],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*c;e[1]=k*b+j*c;e[2]=h*b+l*c;e[3]=f*b+m*c;e[4]=d*-c+g*b;e[5]=k*-c+j*b;e[6]=h*-c+l*b;e[7]=f*-c+m*b;return e},frustum:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2*d/f;h[1]=0; -h[2]=0;h[3]=0;h[4]=0;h[5]=2*d/g;h[6]=0;h[7]=0;h[8]=(b+a)/f;h[9]=(c+e)/g;h[10]=-(k+d)/j;h[11]=-1;h[12]=0;h[13]=0;h[14]=-(2*k*d)/j;h[15]=0;return h},perspective:function(a,b,e,c,d){a=e*Math.tan(a*Math.PI/360);b*=a;return y.frustum(-b,b,-a,a,e,c,d)},ortho:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2/f;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/g;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/j;h[11]=0;h[12]=-(a+b)/f;h[13]=-(c+e)/g;h[14]=-(k+d)/j;h[15]=1;return h},lookAt:function(a,b,e,c){c|| -(c=y.create());var d,k,h,f,g,j,l,m,n=a[0],p=a[1];a=a[2];h=e[0];f=e[1];k=e[2];l=b[0];e=b[1];d=b[2];if(n===l&&p===e&&a===d)return y.identity(c);b=n-l;e=p-e;l=a-d;m=1/Math.sqrt(b*b+e*e+l*l);b*=m;e*=m;l*=m;d=f*l-k*e;k=k*b-h*l;h=h*e-f*b;(m=Math.sqrt(d*d+k*k+h*h))?(m=1/m,d*=m,k*=m,h*=m):h=k=d=0;f=e*h-l*k;g=l*d-b*h;j=b*k-e*d;(m=Math.sqrt(f*f+g*g+j*j))?(m=1/m,f*=m,g*=m,j*=m):j=g=f=0;c[0]=d;c[1]=f;c[2]=b;c[3]=0;c[4]=k;c[5]=g;c[6]=e;c[7]=0;c[8]=h;c[9]=j;c[10]=l;c[11]=0;c[12]=-(d*n+k*p+h*a);c[13]=-(f*n+g*p+ -j*a);c[14]=-(b*n+e*p+l*a);c[15]=1;return c},fromRotationTranslation:function(a,b,e){e||(e=y.create());var c=a[0],d=a[1],k=a[2],h=a[3],f=c+c,g=d+d,j=k+k;a=c*f;var l=c*g,c=c*j,m=d*g,d=d*j,k=k*j,f=h*f,g=h*g,h=h*j;e[0]=1-(m+k);e[1]=l+h;e[2]=c-g;e[3]=0;e[4]=l-h;e[5]=1-(a+k);e[6]=d+f;e[7]=0;e[8]=c+g;e[9]=d-f;e[10]=1-(a+m);e[11]=0;e[12]=b[0];e[13]=b[1];e[14]=b[2];e[15]=1;return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ -a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},s={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,e,c){var d=new l(4);d[0]=a;d[1]=b;d[2]=e;d[3]=c;return d},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=s.create()); -a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},O=s.identity();s.calculateW=function(a,b){var e=a[0],c=a[1],d=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d)),a;b[0]=e;b[1]=c;b[2]=d;b[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d));return b};s.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};s.inverse=function(a,b){var e=a[0],c=a[1],d=a[2],f=a[3],e=(e=e*e+c*c+d*d+f*f)?1/e:0;if(!b||a===b)return a[0]*=-e,a[1]*=-e,a[2]*=-e,a[3]*=e,a;b[0]=-a[0]*e;b[1]=-a[1]*e;b[2]=-a[2]*e;b[3]=a[3]*e; -return b};s.conjugate=function(a,b){if(!b||a===b)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};s.length=function(a){var b=a[0],e=a[1],c=a[2];a=a[3];return Math.sqrt(b*b+e*e+c*c+a*a)};s.normalize=function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],f=a[3],h=Math.sqrt(e*e+c*c+d*d+f*f);if(0===h)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;h=1/h;b[0]=e*h;b[1]=c*h;b[2]=d*h;b[3]=f*h;return b};s.add=function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+= -b[3],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];e[3]=a[3]+b[3];return e};s.multiply=function(a,b,e){e||(e=a);var c=a[0],d=a[1],f=a[2];a=a[3];var h=b[0],g=b[1],j=b[2];b=b[3];e[0]=c*b+a*h+d*j-f*g;e[1]=d*b+a*g+f*h-c*j;e[2]=f*b+a*j+c*g-d*h;e[3]=a*b-c*h-d*g-f*j;return e};s.multiplyVec3=function(a,b,e){e||(e=b);var c=b[0],d=b[1],f=b[2];b=a[0];var h=a[1],g=a[2];a=a[3];var j=a*c+h*f-g*d,l=a*d+g*c-b*f,m=a*f+b*d-h*c,c=-b*c-h*d-g*f;e[0]=j*a+c*-b+l*-g-m*-h;e[1]=l*a+c*-h+m*-b-j*-g;e[2]=m*a+c*-g+j*-h-l*-b; -return e};s.scale=function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a[3]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;e[3]=a[3]*b;return e};s.toMat3=function(a,b){b||(b=F.create());var e=a[0],c=a[1],d=a[2],f=a[3],h=e+e,g=c+c,j=d+d,l=e*h,m=e*g,e=e*j,n=c*g,c=c*j,d=d*j,h=f*h,g=f*g,f=f*j;b[0]=1-(n+d);b[1]=m+f;b[2]=e-g;b[3]=m-f;b[4]=1-(l+d);b[5]=c+h;b[6]=e+g;b[7]=c-h;b[8]=1-(l+n);return b};s.toMat4=function(a,b){b||(b=y.create());var e=a[0],c=a[1],d=a[2],f=a[3],g=e+e,j=c+c,l=d+d,m=e*g,n=e*j,e=e* -l,p=c*j,c=c*l,d=d*l,g=f*g,j=f*j,f=f*l;b[0]=1-(p+d);b[1]=n+f;b[2]=e-j;b[3]=0;b[4]=n-f;b[5]=1-(m+d);b[6]=c+g;b[7]=0;b[8]=e+j;b[9]=c-g;b[10]=1-(m+p);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};s.slerp=function(a,b,c,d){d||(d=a);var f=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],g,h;if(1<=Math.abs(f))return d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d;g=Math.acos(f);h=Math.sqrt(1-f*f);if(0.001>Math.abs(h))return d[0]=0.5*a[0]+0.5*b[0],d[1]=0.5*a[1]+0.5*b[1],d[2]=0.5*a[2]+0.5*b[2],d[3]=0.5*a[3]+ -0.5*b[3],d;f=Math.sin((1-c)*g)/h;c=Math.sin(c*g)/h;d[0]=a[0]*f+b[0]*c;d[1]=a[1]*f+b[1]*c;d[2]=a[2]*f+b[2]*c;d[3]=a[3]*f+b[3]*c;return d};s.fromRotationMatrix=function(a,b){b||(b=s.create());var c=a[0]+a[4]+a[8],d;if(0a[0]&&(c=1);a[8]>a[3*c+c]&&(c=2);var f=d[c],g=d[f];d=Math.sqrt(a[3*c+c]-a[3*f+f]-a[3*g+g]+1);b[c]=0.5*d;d= -0.5/d;b[3]=(a[3*g+f]-a[3*f+g])*d;b[f]=(a[3*f+c]+a[3*c+f])*d;b[g]=(a[3*g+c]+a[3*c+g])*d}return b};F.toQuat4=s.fromRotationMatrix;var D=F.create();s.fromAxes=function(a,b,c,d){D[0]=b[0];D[3]=b[1];D[6]=b[2];D[1]=c[0];D[4]=c[1];D[7]=c[2];D[2]=a[0];D[5]=a[1];D[8]=a[2];return s.fromRotationMatrix(D,d)};s.identity=function(a){a||(a=s.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};s.fromAngleAxis=function(a,b,c){c||(c=s.create());a*=0.5;var d=Math.sin(a);c[3]=Math.cos(a);c[0]=d*b[0];c[1]=d*b[1];c[2]=d*b[2]; -return c};s.toAngleAxis=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); -b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 -Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],f=a[2],g=a[3],h=c*g-f*d;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-d*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, -b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];c[0]=d*b[0]+f*b[2];c[1]=d*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=d*b+f*h;c[1]=d*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var d=b[0];b=b[1];c[0]=d*a[0]+b*a[1];c[1]=d*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var d=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=d*b;c[2]=f*h;c[3]= -g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,d){var f=new l(4);f[0]=a;f[1]=b;f[2]=c;f[3]=d;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, -b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| -(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)},squaredLength:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};c&&(c.glMatrixArrayType=l,c.MatrixArray=l,c.setMatrixArrayType=d,c.determineMatrixArrayType= -f,c.glMath=g,c.vec2=M,c.vec3=j,c.vec4=N,c.mat2=L,c.mat3=F,c.mat4=y,c.quat4=s);return{glMatrixArrayType:l,MatrixArray:l,setMatrixArrayType:d,determineMatrixArrayType:f,glMath:g,vec2:M,vec3:j,vec4:N,mat2:L,mat3:F,mat4:y,quat4:s}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * vColor;","}"]; -PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"]; -PIXI.CompileVertexShader=function(c,d){for(var f="",g=0;g>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/examples/bunny benchmark/index.html b/examples/bunny benchmark/index.html index 7c5521b..95972c4 100644 --- a/examples/bunny benchmark/index.html +++ b/examples/bunny benchmark/index.html @@ -9,9 +9,10 @@ +
    Click to add more bunnys! Let me know how many you get on screen here @doormat23
    - + diff --git a/examples/bunny benchmark/js/bunnyBenchMark.js b/examples/bunny benchmark/js/bunnyBenchMark.js index a3154eb..c3c8ec5 100644 --- a/examples/bunny benchmark/js/bunnyBenchMark.js +++ b/examples/bunny benchmark/js/bunnyBenchMark.js @@ -22,18 +22,13 @@ var count = 0; var container; +var detail; + function onReady() { - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() + detail = document.getElementById("pixi"); - if(webgl) - { - renderer = new PIXI.WebGLRenderer(); - } - else - { - renderer = new PIXI.CanvasRenderer(480, 320); - } + renderer = PIXI.autoDetectRenderer(); stage = new PIXI.Stage; @@ -46,7 +41,7 @@ stats.domElement.style.top = "0px"; requestAnimFrame(update); - wabbitTexture = new PIXI.Texture("wabbit.png") + wabbitTexture = new PIXI.Texture.fromImage("wabbit.png") counter = document.createElement("div"); counter.className = "counter"; @@ -55,7 +50,6 @@ count = startBunnyCount; counter.innerHTML = count + " BUNNIES"; - container = new PIXI.DisplayObjectContainer(); stage.addChild(container); @@ -114,7 +108,9 @@ minX = 0; maxY = height; minY = 0; - + + detail.style.left = width - 204 + "px"; + detail.style.top = height - 100 + "px"; renderer.resize(width, height); } @@ -126,17 +122,17 @@ { // add 10 at a time :) - for (var i = 0; i < 2; i++) + for (var i = 0; i < 10; i++) { - var bunny = new PIXI.Sprite(wabbitTexture, {x:0, y:0, width:26, height:37}); + var bunny = new PIXI.Sprite(wabbitTexture); bunny.speedX = Math.random() * 10; bunny.speedY = (Math.random() * 10) - 5; bunny.anchor.x = 0.5; bunny.anchor.y = 1; - bunny.alpha = 0.3 + Math.random() * 0.7; + //bunny.alpha = 0.3 + Math.random() * 0.7; bunnys.push(bunny); - bunny.rotation = Math.random() - 0.5; + //bunny.rotation = Math.random() - 0.5; container.addChild(bunny); count++; diff --git a/examples/bunny benchmark/js/pixi.js b/examples/bunny benchmark/js/pixi.js new file mode 100644 index 0000000..65add09 --- /dev/null +++ b/examples/bunny benchmark/js/pixi.js @@ -0,0 +1,110 @@ +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, +d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* +j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= +a[0]-d[0],c=a[1]-d[1];a=a[2]-d[2];d=Math.sqrt(b*b+c*c+a*a);if(!d)return j[0]=0,j[1]=0,j[2]=0,j;d=1/d;j[0]=b*d;j[1]=c*d;j[2]=a*d;return j},lerp:function(a,d,j,b){b||(b=a);b[0]=a[0]+j*(d[0]-a[0]);b[1]=a[1]+j*(d[1]-a[1]);b[2]=a[2]+j*(d[2]-a[2]);return b},dist:function(a,d){var j=d[0]-a[0],b=d[1]-a[1],c=d[2]-a[2];return Math.sqrt(j*j+b*b+c*c)}},p=null,q=new k(4);l.unproject=function(a,d,j,b,c){c||(c=a);p||(p=t.create());var e=p;q[0]=2*(a[0]-b[0])/b[2]-1;q[1]=2*(a[1]-b[1])/b[3]-1;q[2]=2*a[2]-1;q[3]=1; +t.multiply(j,d,e);if(!t.inverse(e))return null;t.multiplyVec4(e,q);if(0===q[3])return null;c[0]=q[0]/q[3];c[1]=q[1]/q[3];c[2]=q[2]/q[3];return c};var C=l.createFrom(1,0,0),F=l.createFrom(0,1,0),u=l.createFrom(0,0,1),w=l.create();l.rotationTo=function(a,d,j){j||(j=m.create());var b=l.dot(a,d);if(1<=b)m.set(H,j);else if(-0.999999>b)l.cross(C,a,w),1E-6>l.length(w)&&l.cross(F,a,w),1E-6>l.length(w)&&l.cross(u,a,w),l.normalize(w),m.fromAngleAxis(Math.PI,w,j);else{var b=Math.sqrt(2*(1+b)),c=1/b;l.cross(a, +d,w);j[0]=w[0]*c;j[1]=w[1]*c;j[2]=w[2]*c;j[3]=0.5*b;m.normalize(j)}1j[3]&&(j[3]=-1);return j};l.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var x={create:function(a){var d=new k(9);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8]):d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=0;return d},createFrom:function(a,d,j,b,c,e,n,f,E){var s=new k(9);s[0]=a;s[1]=d;s[2]=j;s[3]=b;s[4]=c;s[5]=e;s[6]=n;s[7]=f;s[8]=E;return s},determinant:function(a){var d= +a[3],j=a[4],b=a[5],c=a[6],e=a[7],n=a[8];return a[0]*(n*j-b*e)+a[1]*(-n*d+b*c)+a[2]*(e*d-j*c)},inverse:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[3],n=a[4],f=a[5],E=a[6],s=a[7],I=a[8],g=I*n-f*s,h=-I*e+f*E,k=s*e-n*E,r=j*g+b*h+c*k;if(!r)return null;r=1/r;d||(d=x.create());d[0]=g*r;d[1]=(-I*b+c*s)*r;d[2]=(f*b-c*n)*r;d[3]=h*r;d[4]=(I*j-c*E)*r;d[5]=(-f*j+c*e)*r;d[6]=k*r;d[7]=(-s*j+b*E)*r;d[8]=(n*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],D=a[4],E=a[5],s=a[6],I= +a[7];a=a[8];var g=d[0],h=d[1],k=d[2],r=d[3],m=d[4],l=d[5],q=d[6],v=d[7];d=d[8];j[0]=g*b+h*f+k*s;j[1]=g*c+h*D+k*I;j[2]=g*e+h*E+k*a;j[3]=r*b+m*f+l*s;j[4]=r*c+m*D+l*I;j[5]=r*e+m*E+l*a;j[6]=q*b+v*f+d*s;j[7]=q*c+v*D+d*I;j[8]=q*e+v*E+d*a;return j},multiplyVec2:function(a,d,j){j||(j=d);var b=d[0];d=d[1];j[0]=b*a[0]+d*a[3]+a[6];j[1]=b*a[1]+d*a[4]+a[7];return j},multiplyVec3:function(a,d,j){j||(j=d);var b=d[0],c=d[1];d=d[2];j[0]=b*a[0]+c*a[3]+d*a[6];j[1]=b*a[1]+c*a[4]+d*a[7];j[2]=b*a[2]+c*a[5]+d*a[8];return j}, +set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])},identity:function(a){a||(a=x.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, +d){if(!d||a===d){var j=a[1],b=a[2],c=a[5];a[1]=a[3];a[2]=a[6];a[3]=j;a[5]=a[7];a[6]=b;a[7]=c;return a}d[0]=a[0];d[1]=a[3];d[2]=a[6];d[3]=a[1];d[4]=a[4];d[5]=a[7];d[6]=a[2];d[7]=a[5];d[8]=a[8];return d},toMat4:function(a,d){d||(d=t.create());d[15]=1;d[14]=0;d[13]=0;d[12]=0;d[11]=0;d[10]=a[8];d[9]=a[7];d[8]=a[6];d[7]=0;d[6]=a[5];d[5]=a[4];d[4]=a[3];d[3]=0;d[2]=a[2];d[1]=a[1];d[0]=a[0];return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ +a[8]+"]"}},t={create:function(a){var d=new k(16);a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8],d[9]=a[9],d[10]=a[10],d[11]=a[11],d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d},createFrom:function(a,d,j,b,c,e,f,D,E,s,g,h,m,l,r,q){var A=new k(16);A[0]=a;A[1]=d;A[2]=j;A[3]=b;A[4]=c;A[5]=e;A[6]=f;A[7]=D;A[8]=E;A[9]=s;A[10]=g;A[11]=h;A[12]=m;A[13]=l;A[14]=r;A[15]=q;return A},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4]; +d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=a[12];d[13]=a[13];d[14]=a[14];d[15]=a[15];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])&&1E-6>Math.abs(a[9]-d[9])&&1E-6>Math.abs(a[10]-d[10])&&1E-6>Math.abs(a[11]-d[11])&&1E-6>Math.abs(a[12]- +d[12])&&1E-6>Math.abs(a[13]-d[13])&&1E-6>Math.abs(a[14]-d[14])&&1E-6>Math.abs(a[15]-d[15])},identity:function(a){a||(a=t.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,d){if(!d||a===d){var j=a[1],b=a[2],c=a[3],e=a[6],f=a[7],D=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=j;a[6]=a[9];a[7]=a[13];a[8]=b;a[9]=e;a[11]=a[14];a[12]=c;a[13]=f;a[14]=D;return a}d[0]=a[0];d[1]=a[4];d[2]=a[8];d[3]=a[12]; +d[4]=a[1];d[5]=a[5];d[6]=a[9];d[7]=a[13];d[8]=a[2];d[9]=a[6];d[10]=a[10];d[11]=a[14];d[12]=a[3];d[13]=a[7];d[14]=a[11];d[15]=a[15];return d},determinant:function(a){var d=a[0],j=a[1],b=a[2],c=a[3],e=a[4],f=a[5],D=a[6],E=a[7],s=a[8],g=a[9],h=a[10],k=a[11],m=a[12],r=a[13],l=a[14];a=a[15];return m*g*D*c-s*r*D*c-m*f*h*c+e*r*h*c+s*f*l*c-e*g*l*c-m*g*b*E+s*r*b*E+m*j*h*E-d*r*h*E-s*j*l*E+d*g*l*E+m*f*b*k-e*r*b*k-m*j*D*k+d*r*D*k+e*j*l*k-d*f*l*k-s*f*b*a+e*g*b*a+s*j*D*a-d*g*D*a-e*j*h*a+d*f*h*a},inverse:function(a, +d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=a[3],f=a[4],D=a[5],E=a[6],s=a[7],g=a[8],h=a[9],k=a[10],m=a[11],r=a[12],l=a[13],A=a[14],q=a[15],v=j*D-b*f,J=j*E-c*f,y=j*s-e*f,z=b*E-c*D,t=b*s-e*D,u=c*s-e*E,p=g*l-h*r,w=g*A-k*r,x=g*q-m*r,B=h*A-k*l,C=h*q-m*l,F=k*q-m*A,G=v*F-J*C+y*B+z*x-t*w+u*p;if(!G)return null;G=1/G;d[0]=(D*F-E*C+s*B)*G;d[1]=(-b*F+c*C-e*B)*G;d[2]=(l*u-A*t+q*z)*G;d[3]=(-h*u+k*t-m*z)*G;d[4]=(-f*F+E*x-s*w)*G;d[5]=(j*F-c*x+e*w)*G;d[6]=(-r*u+A*y-q*J)*G;d[7]=(g*u-k*y+m*J)*G;d[8]=(f*C-D*x+s*p)*G;d[9]= +(-j*C+b*x-e*p)*G;d[10]=(r*t-l*y+q*v)*G;d[11]=(-g*t+h*y-m*v)*G;d[12]=(-f*B+D*w-E*p)*G;d[13]=(j*B-b*w+c*p)*G;d[14]=(-r*z+l*J-A*v)*G;d[15]=(g*z-h*J+k*v)*G;return d},toRotationMat:function(a,d){d||(d=t.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d},toMat3:function(a,d){d||(d=x.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[4];d[4]=a[5];d[5]=a[6];d[6]=a[8];d[7]=a[9];d[8]=a[10]; +return d},toInverseMat3:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[4],f=a[5],D=a[6],g=a[8],s=a[9],h=a[10],k=h*f-D*s,m=-h*e+D*g,l=s*e-f*g,r=j*k+b*m+c*l;if(!r)return null;r=1/r;d||(d=x.create());d[0]=k*r;d[1]=(-h*b+c*s)*r;d[2]=(D*b-c*f)*r;d[3]=m*r;d[4]=(h*j-c*g)*r;d[5]=(-D*j+c*e)*r;d[6]=l*r;d[7]=(-s*j+b*g)*r;d[8]=(f*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],s=a[6],k=a[7],m=a[8],l=a[9],q=a[10],r=a[11],t=a[12],A=a[13],u=a[14];a=a[15];var v=d[0], +p=d[1],y=d[2],z=d[3];j[0]=v*b+p*g+y*m+z*t;j[1]=v*c+p*h+y*l+z*A;j[2]=v*e+p*s+y*q+z*u;j[3]=v*f+p*k+y*r+z*a;v=d[4];p=d[5];y=d[6];z=d[7];j[4]=v*b+p*g+y*m+z*t;j[5]=v*c+p*h+y*l+z*A;j[6]=v*e+p*s+y*q+z*u;j[7]=v*f+p*k+y*r+z*a;v=d[8];p=d[9];y=d[10];z=d[11];j[8]=v*b+p*g+y*m+z*t;j[9]=v*c+p*h+y*l+z*A;j[10]=v*e+p*s+y*q+z*u;j[11]=v*f+p*k+y*r+z*a;v=d[12];p=d[13];y=d[14];z=d[15];j[12]=v*b+p*g+y*m+z*t;j[13]=v*c+p*h+y*l+z*A;j[14]=v*e+p*s+y*q+z*u;j[15]=v*f+p*k+y*r+z*a;return j},multiplyVec3:function(a,d,b){b||(b=d); +var c=d[0],e=d[1];d=d[2];b[0]=a[0]*c+a[4]*e+a[8]*d+a[12];b[1]=a[1]*c+a[5]*e+a[9]*d+a[13];b[2]=a[2]*c+a[6]*e+a[10]*d+a[14];return b},multiplyVec4:function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=d[3];b[0]=a[0]*c+a[4]*e+a[8]*f+a[12]*d;b[1]=a[1]*c+a[5]*e+a[9]*f+a[13]*d;b[2]=a[2]*c+a[6]*e+a[10]*f+a[14]*d;b[3]=a[3]*c+a[7]*e+a[11]*f+a[15]*d;return b},translate:function(a,d,b){var c=d[0],e=d[1];d=d[2];var f,n,g,h,s,k,m,l,p,r,q,t;if(!b||a===b)return a[12]=a[0]*c+a[4]*e+a[8]*d+a[12],a[13]=a[1]*c+a[5]*e+ +a[9]*d+a[13],a[14]=a[2]*c+a[6]*e+a[10]*d+a[14],a[15]=a[3]*c+a[7]*e+a[11]*d+a[15],a;f=a[0];n=a[1];g=a[2];h=a[3];s=a[4];k=a[5];m=a[6];l=a[7];p=a[8];r=a[9];q=a[10];t=a[11];b[0]=f;b[1]=n;b[2]=g;b[3]=h;b[4]=s;b[5]=k;b[6]=m;b[7]=l;b[8]=p;b[9]=r;b[10]=q;b[11]=t;b[12]=f*c+s*e+p*d+a[12];b[13]=n*c+k*e+r*d+a[13];b[14]=g*c+m*e+q*d+a[14];b[15]=h*c+l*e+t*d+a[15];return b},scale:function(a,d,b){var c=d[0],e=d[1];d=d[2];if(!b||a===b)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=d,a[9]*= +d,a[10]*=d,a[11]*=d,a;b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[7]=a[7]*e;b[8]=a[8]*d;b[9]=a[9]*d;b[10]=a[10]*d;b[11]=a[11]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},rotate:function(a,d,b,c){var e=b[0],f=b[1];b=b[2];var n=Math.sqrt(e*e+f*f+b*b),g,h,k,m,l,p,q,r,t,u,w,v,x,y,z,B,C,F,H,K;if(!n)return null;1!==n&&(n=1/n,e*=n,f*=n,b*=n);g=Math.sin(d);h=Math.cos(d);k=1-h;d=a[0];n=a[1];m=a[2];l=a[3];p=a[4];q=a[5];r=a[6];t=a[7];u=a[8];w=a[9];v= +a[10];x=a[11];y=e*e*k+h;z=f*e*k+b*g;B=b*e*k-f*g;C=e*f*k-b*g;F=f*f*k+h;H=b*f*k+e*g;K=e*b*k+f*g;e=f*b*k-e*g;f=b*b*k+h;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=d*y+p*z+u*B;c[1]=n*y+q*z+w*B;c[2]=m*y+r*z+v*B;c[3]=l*y+t*z+x*B;c[4]=d*C+p*F+u*H;c[5]=n*C+q*F+w*H;c[6]=m*C+r*F+v*H;c[7]=l*C+t*F+x*H;c[8]=d*K+p*e+u*f;c[9]=n*K+q*e+w*f;c[10]=m*K+r*e+v*f;c[11]=l*K+t*e+x*f;return c},rotateX:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[4],f=a[5],n=a[6],g=a[7],h=a[8],k=a[9],m=a[10], +l=a[11];b?a!==b&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[4]=e*d+h*c;b[5]=f*d+k*c;b[6]=n*d+m*c;b[7]=g*d+l*c;b[8]=e*-c+h*d;b[9]=f*-c+k*d;b[10]=n*-c+m*d;b[11]=g*-c+l*d;return b},rotateY:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[8],k=a[9],m=a[10],l=a[11];b?a!==b&&(b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*-c;b[1]=f*d+k*-c;b[2]=n*d+m*-c;b[3]=g* +d+l*-c;b[8]=e*c+h*d;b[9]=f*c+k*d;b[10]=n*c+m*d;b[11]=g*c+l*d;return b},rotateZ:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[4],k=a[5],m=a[6],l=a[7];b?a!==b&&(b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*c;b[1]=f*d+k*c;b[2]=n*d+m*c;b[3]=g*d+l*c;b[4]=e*-c+h*d;b[5]=f*-c+k*d;b[6]=n*-c+m*d;b[7]=g*-c+l*d;return b},frustum:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2*e/g;n[1]=0; +n[2]=0;n[3]=0;n[4]=0;n[5]=2*e/h;n[6]=0;n[7]=0;n[8]=(d+a)/g;n[9]=(c+b)/h;n[10]=-(f+e)/k;n[11]=-1;n[12]=0;n[13]=0;n[14]=-(2*f*e)/k;n[15]=0;return n},perspective:function(a,d,b,c,e){a=b*Math.tan(a*Math.PI/360);d*=a;return t.frustum(-d,d,-a,a,b,c,e)},ortho:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2/g;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=2/h;n[6]=0;n[7]=0;n[8]=0;n[9]=0;n[10]=-2/k;n[11]=0;n[12]=-(a+d)/g;n[13]=-(c+b)/h;n[14]=-(f+e)/k;n[15]=1;return n},lookAt:function(a,d,b,c){c|| +(c=t.create());var e,f,n,g,h,k,m,l,p=a[0],q=a[1];a=a[2];n=b[0];g=b[1];f=b[2];m=d[0];b=d[1];e=d[2];if(p===m&&q===b&&a===e)return t.identity(c);d=p-m;b=q-b;m=a-e;l=1/Math.sqrt(d*d+b*b+m*m);d*=l;b*=l;m*=l;e=g*m-f*b;f=f*d-n*m;n=n*b-g*d;(l=Math.sqrt(e*e+f*f+n*n))?(l=1/l,e*=l,f*=l,n*=l):n=f=e=0;g=b*n-m*f;h=m*e-d*n;k=d*f-b*e;(l=Math.sqrt(g*g+h*h+k*k))?(l=1/l,g*=l,h*=l,k*=l):k=h=g=0;c[0]=e;c[1]=g;c[2]=d;c[3]=0;c[4]=f;c[5]=h;c[6]=b;c[7]=0;c[8]=n;c[9]=k;c[10]=m;c[11]=0;c[12]=-(e*p+f*q+n*a);c[13]=-(g*p+h*q+ +k*a);c[14]=-(d*p+b*q+m*a);c[15]=1;return c},fromRotationTranslation:function(a,d,b){b||(b=t.create());var c=a[0],e=a[1],f=a[2],n=a[3],g=c+c,h=e+e,k=f+f;a=c*g;var l=c*h,c=c*k,m=e*h,e=e*k,f=f*k,g=n*g,h=n*h,n=n*k;b[0]=1-(m+f);b[1]=l+n;b[2]=c-h;b[3]=0;b[4]=l-n;b[5]=1-(a+f);b[6]=e+g;b[7]=0;b[8]=c+h;b[9]=e-g;b[10]=1-(a+m);b[11]=0;b[12]=d[0];b[13]=d[1];b[14]=d[2];b[15]=1;return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ +a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},m={create:function(a){var d=new k(4);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]):d[0]=d[1]=d[2]=d[3]=0;return d},createFrom:function(a,d,b,c){var e=new k(4);e[0]=a;e[1]=d;e[2]=b;e[3]=c;return e},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])},identity:function(a){a||(a=m.create()); +a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},H=m.identity();m.calculateW=function(a,d){var b=a[0],c=a[1],e=a[2];if(!d||a===d)return a[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e)),a;d[0]=b;d[1]=c;d[2]=e;d[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e));return d};m.dot=function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3]};m.inverse=function(a,d){var b=a[0],c=a[1],e=a[2],f=a[3],b=(b=b*b+c*c+e*e+f*f)?1/b:0;if(!d||a===d)return a[0]*=-b,a[1]*=-b,a[2]*=-b,a[3]*=b,a;d[0]=-a[0]*b;d[1]=-a[1]*b;d[2]=-a[2]*b;d[3]=a[3]*b; +return d};m.conjugate=function(a,d){if(!d||a===d)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=a[3];return d};m.length=function(a){var d=a[0],b=a[1],c=a[2];a=a[3];return Math.sqrt(d*d+b*b+c*c+a*a)};m.normalize=function(a,d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=Math.sqrt(b*b+c*c+e*e+f*f);if(0===g)return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d;g=1/g;d[0]=b*g;d[1]=c*g;d[2]=e*g;d[3]=f*g;return d};m.add=function(a,d,b){if(!b||a===b)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a[3]+= +d[3],a;b[0]=a[0]+d[0];b[1]=a[1]+d[1];b[2]=a[2]+d[2];b[3]=a[3]+d[3];return b};m.multiply=function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2];a=a[3];var g=d[0],h=d[1],k=d[2];d=d[3];b[0]=c*d+a*g+e*k-f*h;b[1]=e*d+a*h+f*g-c*k;b[2]=f*d+a*k+c*h-e*g;b[3]=a*d-c*g-e*h-f*k;return b};m.multiplyVec3=function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=a[0];var g=a[1],h=a[2];a=a[3];var k=a*c+g*f-h*e,l=a*e+h*c-d*f,m=a*f+d*e-g*c,c=-d*c-g*e-h*f;b[0]=k*a+c*-d+l*-h-m*-g;b[1]=l*a+c*-g+m*-d-k*-h;b[2]=m*a+c*-h+k*-g-l*-d; +return b};m.scale=function(a,d,b){if(!b||a===b)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a;b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[3]=a[3]*d;return b};m.toMat3=function(a,d){d||(d=x.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b*k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=m-f;d[4]=1-(l+e);d[5]=c+g;d[6]=b+h;d[7]=c-g;d[8]=1-(l+p);return d};m.toMat4=function(a,d){d||(d=t.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b* +k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=0;d[4]=m-f;d[5]=1-(l+e);d[6]=c+g;d[7]=0;d[8]=b+h;d[9]=c-g;d[10]=1-(l+p);d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d};m.slerp=function(a,d,b,c){c||(c=a);var e=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3],f,g;if(1<=Math.abs(e))return c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]),c;f=Math.acos(e);g=Math.sqrt(1-e*e);if(0.0010>Math.abs(g))return c[0]=0.5*a[0]+0.5*d[0],c[1]=0.5*a[1]+0.5*d[1],c[2]=0.5*a[2]+0.5*d[2],c[3]=0.5*a[3]+ +0.5*d[3],c;e=Math.sin((1-b)*f)/g;b=Math.sin(b*f)/g;c[0]=a[0]*e+d[0]*b;c[1]=a[1]*e+d[1]*b;c[2]=a[2]*e+d[2]*b;c[3]=a[3]*e+d[3]*b;return c};m.fromRotationMatrix=function(a,d){d||(d=m.create());var b=a[0]+a[4]+a[8],c;if(0a[0]&&(b=1);a[8]>a[3*b+b]&&(b=2);var e=c[b],f=c[e];c=Math.sqrt(a[3*b+b]-a[3*e+e]-a[3*f+f]+1);d[b]=0.5*c;c= +0.5/c;d[3]=(a[3*f+e]-a[3*e+f])*c;d[e]=(a[3*e+b]+a[3*b+e])*c;d[f]=(a[3*f+b]+a[3*b+f])*c}return d};x.toQuat4=m.fromRotationMatrix;var B=x.create();m.fromAxes=function(a,d,b,c){B[0]=d[0];B[3]=d[1];B[6]=d[2];B[1]=b[0];B[4]=b[1];B[7]=b[2];B[2]=a[0];B[5]=a[1];B[8]=a[2];return m.fromRotationMatrix(B,c)};m.identity=function(a){a||(a=m.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};m.fromAngleAxis=function(a,d,b){b||(b=m.create());a*=0.5;var c=Math.sin(a);b[3]=Math.cos(a);b[0]=c*d[0];b[1]=c*d[1];b[2]=c*d[2]; +return b};m.toAngleAxis=function(a,d){d||(d=a);var b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); +b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 +Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],e=a[1],f=a[2],g=a[3],h=c*g-f*e;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-e*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, +b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];c[0]=e*b[0]+f*b[2];c[1]=e*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=e*b+f*h;c[1]=e*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var e=b[0];b=b[1];c[0]=e*a[0]+b*a[1];c[1]=e*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var e=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=e*b;c[2]=f*h;c[3]= +g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, +b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| +(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= +f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; +PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; +PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l>1);var b=m[0];return b*(1.5-0.5*a*b*b)}}else g.invsqrt=function(a){return 1/Math.sqrt(a)}; -var l=null;f();var j={create:function(a){var b=new l(3);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0;return b},createFrom:function(a,b,e){var c=new l(3);c[0]=a;c[1]=b;c[2]=e;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])},add:function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];return e},subtract:function(a, -b,e){if(!e||a===e)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];return e},multiply:function(a,b,e){if(!e||a===e)return a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a;e[0]=a[0]*b[0];e[1]=a[1]*b[1];e[2]=a[2]*b[2];return e},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;return e},normalize:function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=Math.sqrt(e* -e+c*c+d*d);if(!k)return b[0]=0,b[1]=0,b[2]=0,b;if(1===k)return b[0]=e,b[1]=c,b[2]=d,b;k=1/k;b[0]=e*k;b[1]=c*k;b[2]=d*k;return b},cross:function(a,b,e){e||(e=a);var c=a[0],d=a[1];a=a[2];var k=b[0],h=b[1];b=b[2];e[0]=d*b-a*h;e[1]=a*k-c*b;e[2]=c*h-d*k;return e},length:function(a){var b=a[0],e=a[1];a=a[2];return Math.sqrt(b*b+e*e+a*a)},squaredLength:function(a){var b=a[0],e=a[1];a=a[2];return b*b+e*e+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,b,e){e||(e=a);var c= -a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];b=Math.sqrt(c*c+d*d+a*a);if(!b)return e[0]=0,e[1]=0,e[2]=0,e;b=1/b;e[0]=c*b;e[1]=d*b;e[2]=a*b;return e},lerp:function(a,b,e,c){c||(c=a);c[0]=a[0]+e*(b[0]-a[0]);c[1]=a[1]+e*(b[1]-a[1]);c[2]=a[2]+e*(b[2]-a[2]);return c},dist:function(a,b){var e=b[0]-a[0],c=b[1]-a[1],d=b[2]-a[2];return Math.sqrt(e*e+c*c+d*d)}},x=null,n=new l(4);j.unproject=function(a,b,e,c,d){d||(d=a);x||(x=y.create());var k=x;n[0]=2*(a[0]-c[0])/c[2]-1;n[1]=2*(a[1]-c[1])/c[3]-1;n[2]=2*a[2]-1;n[3]=1; -y.multiply(e,b,k);if(!y.inverse(k))return null;y.multiplyVec4(k,n);if(0===n[3])return null;d[0]=n[0]/n[3];d[1]=n[1]/n[3];d[2]=n[2]/n[3];return d};var z=j.createFrom(1,0,0),A=j.createFrom(0,1,0),H=j.createFrom(0,0,1),C=j.create();j.rotationTo=function(a,b,e){e||(e=s.create());var c=j.dot(a,b);if(1<=c)s.set(O,e);else if(-0.999999>c)j.cross(z,a,C),1E-6>j.length(C)&&j.cross(A,a,C),1E-6>j.length(C)&&j.cross(H,a,C),j.normalize(C),s.fromAngleAxis(Math.PI,C,e);else{var c=Math.sqrt(2*(1+c)),d=1/c;j.cross(a, -b,C);e[0]=C[0]*d;e[1]=C[1]*d;e[2]=C[2]*d;e[3]=0.5*c;s.normalize(e)}1e[3]&&(e[3]=-1);return e};j.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var F={create:function(a){var b=new l(9);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0;return b},createFrom:function(a,b,e,c,d,k,h,E,K){var q=new l(9);q[0]=a;q[1]=b;q[2]=e;q[3]=c;q[4]=d;q[5]=k;q[6]=h;q[7]=E;q[8]=K;return q},determinant:function(a){var b= -a[3],e=a[4],c=a[5],d=a[6],k=a[7],h=a[8];return a[0]*(h*e-c*k)+a[1]*(-h*b+c*d)+a[2]*(k*b-e*d)},inverse:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],E=a[5],K=a[6],q=a[7],f=a[8],g=f*h-E*q,j=-f*k+E*K,J=q*k-h*K,r=e*g+c*j+d*J;if(!r)return null;r=1/r;b||(b=F.create());b[0]=g*r;b[1]=(-f*c+d*q)*r;b[2]=(E*c-d*h)*r;b[3]=j*r;b[4]=(f*e-d*K)*r;b[5]=(-E*e+d*k)*r;b[6]=J*r;b[7]=(-q*e+c*K)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],E=a[4],f=a[5],q=a[6],g= -a[7];a=a[8];var u=b[0],j=b[1],J=b[2],r=b[3],l=b[4],t=b[5],m=b[6],p=b[7];b=b[8];e[0]=u*c+j*h+J*q;e[1]=u*d+j*E+J*g;e[2]=u*k+j*f+J*a;e[3]=r*c+l*h+t*q;e[4]=r*d+l*E+t*g;e[5]=r*k+l*f+t*a;e[6]=m*c+p*h+b*q;e[7]=m*d+p*E+b*g;e[8]=m*k+p*f+b*a;return e},multiplyVec2:function(a,b,e){e||(e=b);var c=b[0];b=b[1];e[0]=c*a[0]+b*a[3]+a[6];e[1]=c*a[1]+b*a[4]+a[7];return e},multiplyVec3:function(a,b,e){e||(e=b);var c=b[0],d=b[1];b=b[2];e[0]=c*a[0]+d*a[3]+b*a[6];e[1]=c*a[1]+d*a[4]+b*a[7];e[2]=c*a[2]+d*a[5]+b*a[8];return e}, -set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])},identity:function(a){a||(a=F.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, -b){if(!b||a===b){var e=a[1],c=a[2],d=a[5];a[1]=a[3];a[2]=a[6];a[3]=e;a[5]=a[7];a[6]=c;a[7]=d;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]=a[8];return b},toMat4:function(a,b){b||(b=y.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ -a[8]+"]"}},y={create:function(a){var b=new l(16);a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]);return b},createFrom:function(a,b,e,c,d,k,h,E,f,q,g,u,j,J,r,m){var t=new l(16);t[0]=a;t[1]=b;t[2]=e;t[3]=c;t[4]=d;t[5]=k;t[6]=h;t[7]=E;t[8]=f;t[9]=q;t[10]=g;t[11]=u;t[12]=j;t[13]=J;t[14]=r;t[15]=m;return t},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4]; -b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])&&1E-6>Math.abs(a[9]-b[9])&&1E-6>Math.abs(a[10]-b[10])&&1E-6>Math.abs(a[11]-b[11])&&1E-6>Math.abs(a[12]- -b[12])&&1E-6>Math.abs(a[13]-b[13])&&1E-6>Math.abs(a[14]-b[14])&&1E-6>Math.abs(a[15]-b[15])},identity:function(a){a||(a=y.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){var e=a[1],c=a[2],d=a[3],k=a[6],h=a[7],E=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=e;a[6]=a[9];a[7]=a[13];a[8]=c;a[9]=k;a[11]=a[14];a[12]=d;a[13]=h;a[14]=E;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12]; -b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b=a[0],e=a[1],c=a[2],d=a[3],k=a[4],h=a[5],E=a[6],f=a[7],g=a[8],I=a[9],u=a[10],j=a[11],l=a[12],r=a[13],m=a[14];a=a[15];return l*I*E*d-g*r*E*d-l*h*u*d+k*r*u*d+g*h*m*d-k*I*m*d-l*I*c*f+g*r*c*f+l*e*u*f-b*r*u*f-g*e*m*f+b*I*m*f+l*h*c*j-k*r*c*j-l*e*E*j+b*r*E*j+k*e*m*j-b*h*m*j-g*h*c*a+k*I*c*a+g*e*E*a-b*I*E*a-k*e*u*a+b*h*u*a},inverse:function(a, -b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],f=a[5],g=a[6],q=a[7],I=a[8],u=a[9],j=a[10],l=a[11],r=a[12],m=a[13],t=a[14],p=a[15],s=e*f-c*h,n=e*g-d*h,v=e*q-k*h,w=c*g-d*f,x=c*q-k*f,y=d*q-k*g,z=I*m-u*r,A=I*t-j*r,C=I*p-l*r,D=u*t-j*m,F=u*p-l*m,H=j*p-l*t,G=s*H-n*F+v*D+w*C-x*A+y*z;if(!G)return null;G=1/G;b[0]=(f*H-g*F+q*D)*G;b[1]=(-c*H+d*F-k*D)*G;b[2]=(m*y-t*x+p*w)*G;b[3]=(-u*y+j*x-l*w)*G;b[4]=(-h*H+g*C-q*A)*G;b[5]=(e*H-d*C+k*A)*G;b[6]=(-r*y+t*v-p*n)*G;b[7]=(I*y-j*v+l*n)*G;b[8]=(h*F-f*C+q*z)*G;b[9]= -(-e*F+c*C-k*z)*G;b[10]=(r*x-m*v+p*s)*G;b[11]=(-I*x+u*v-l*s)*G;b[12]=(-h*D+f*A-g*z)*G;b[13]=(e*D-c*A+d*z)*G;b[14]=(-r*w+m*n-t*s)*G;b[15]=(I*w-u*n+j*s)*G;return b},toRotationMat:function(a,b){b||(b=y.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=F.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10]; -return b},toInverseMat3:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[4],h=a[5],f=a[6],g=a[8],q=a[9],j=a[10],u=j*h-f*q,l=-j*k+f*g,m=q*k-h*g,r=e*u+c*l+d*m;if(!r)return null;r=1/r;b||(b=F.create());b[0]=u*r;b[1]=(-j*c+d*q)*r;b[2]=(f*c-d*h)*r;b[3]=l*r;b[4]=(j*e-d*g)*r;b[5]=(-f*e+d*k)*r;b[6]=m*r;b[7]=(-q*e+c*g)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],f=a[4],g=a[5],q=a[6],j=a[7],u=a[8],l=a[9],m=a[10],r=a[11],p=a[12],t=a[13],s=a[14];a=a[15];var n=b[0], -B=b[1],v=b[2],w=b[3];e[0]=n*c+B*f+v*u+w*p;e[1]=n*d+B*g+v*l+w*t;e[2]=n*k+B*q+v*m+w*s;e[3]=n*h+B*j+v*r+w*a;n=b[4];B=b[5];v=b[6];w=b[7];e[4]=n*c+B*f+v*u+w*p;e[5]=n*d+B*g+v*l+w*t;e[6]=n*k+B*q+v*m+w*s;e[7]=n*h+B*j+v*r+w*a;n=b[8];B=b[9];v=b[10];w=b[11];e[8]=n*c+B*f+v*u+w*p;e[9]=n*d+B*g+v*l+w*t;e[10]=n*k+B*q+v*m+w*s;e[11]=n*h+B*j+v*r+w*a;n=b[12];B=b[13];v=b[14];w=b[15];e[12]=n*c+B*f+v*u+w*p;e[13]=n*d+B*g+v*l+w*t;e[14]=n*k+B*q+v*m+w*s;e[15]=n*h+B*j+v*r+w*a;return e},multiplyVec3:function(a,b,e){e||(e=b); -var c=b[0],d=b[1];b=b[2];e[0]=a[0]*c+a[4]*d+a[8]*b+a[12];e[1]=a[1]*c+a[5]*d+a[9]*b+a[13];e[2]=a[2]*c+a[6]*d+a[10]*b+a[14];return e},multiplyVec4:function(a,b,e){e||(e=b);var c=b[0],d=b[1],k=b[2];b=b[3];e[0]=a[0]*c+a[4]*d+a[8]*k+a[12]*b;e[1]=a[1]*c+a[5]*d+a[9]*k+a[13]*b;e[2]=a[2]*c+a[6]*d+a[10]*k+a[14]*b;e[3]=a[3]*c+a[7]*d+a[11]*k+a[15]*b;return e},translate:function(a,b,e){var c=b[0],d=b[1];b=b[2];var k,h,f,g,q,j,u,l,m,n,p,s;if(!e||a===e)return a[12]=a[0]*c+a[4]*d+a[8]*b+a[12],a[13]=a[1]*c+a[5]*d+ -a[9]*b+a[13],a[14]=a[2]*c+a[6]*d+a[10]*b+a[14],a[15]=a[3]*c+a[7]*d+a[11]*b+a[15],a;k=a[0];h=a[1];f=a[2];g=a[3];q=a[4];j=a[5];u=a[6];l=a[7];m=a[8];n=a[9];p=a[10];s=a[11];e[0]=k;e[1]=h;e[2]=f;e[3]=g;e[4]=q;e[5]=j;e[6]=u;e[7]=l;e[8]=m;e[9]=n;e[10]=p;e[11]=s;e[12]=k*c+q*d+m*b+a[12];e[13]=h*c+j*d+n*b+a[13];e[14]=f*c+u*d+p*b+a[14];e[15]=g*c+l*d+s*b+a[15];return e},scale:function(a,b,e){var c=b[0],d=b[1];b=b[2];if(!e||a===e)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=d,a[5]*=d,a[6]*=d,a[7]*=d,a[8]*=b,a[9]*= -b,a[10]*=b,a[11]*=b,a;e[0]=a[0]*c;e[1]=a[1]*c;e[2]=a[2]*c;e[3]=a[3]*c;e[4]=a[4]*d;e[5]=a[5]*d;e[6]=a[6]*d;e[7]=a[7]*d;e[8]=a[8]*b;e[9]=a[9]*b;e[10]=a[10]*b;e[11]=a[11]*b;e[12]=a[12];e[13]=a[13];e[14]=a[14];e[15]=a[15];return e},rotate:function(a,b,e,c){var d=e[0],k=e[1];e=e[2];var h=Math.sqrt(d*d+k*k+e*e),f,g,q,j,l,m,n,r,p,s,x,y,B,v,w,z,A,C,D,F;if(!h)return null;1!==h&&(h=1/h,d*=h,k*=h,e*=h);f=Math.sin(b);g=Math.cos(b);q=1-g;b=a[0];h=a[1];j=a[2];l=a[3];m=a[4];n=a[5];r=a[6];p=a[7];s=a[8];x=a[9];y= -a[10];B=a[11];v=d*d*q+g;w=k*d*q+e*f;z=e*d*q-k*f;A=d*k*q-e*f;C=k*k*q+g;D=e*k*q+d*f;F=d*e*q+k*f;d=k*e*q-d*f;k=e*e*q+g;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=b*v+m*w+s*z;c[1]=h*v+n*w+x*z;c[2]=j*v+r*w+y*z;c[3]=l*v+p*w+B*z;c[4]=b*A+m*C+s*D;c[5]=h*A+n*C+x*D;c[6]=j*A+r*C+y*D;c[7]=l*A+p*C+B*D;c[8]=b*F+m*d+s*k;c[9]=h*F+n*d+x*k;c[10]=j*F+r*d+y*k;c[11]=l*F+p*d+B*k;return c},rotateX:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[4],k=a[5],h=a[6],f=a[7],g=a[8],q=a[9],j=a[10], -l=a[11];e?a!==e&&(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[4]=d*b+g*c;e[5]=k*b+q*c;e[6]=h*b+j*c;e[7]=f*b+l*c;e[8]=d*-c+g*b;e[9]=k*-c+q*b;e[10]=h*-c+j*b;e[11]=f*-c+l*b;return e},rotateY:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[8],j=a[9],l=a[10],m=a[11];e?a!==e&&(e[4]=a[4],e[5]=a[5],e[6]=a[6],e[7]=a[7],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*-c;e[1]=k*b+j*-c;e[2]=h*b+l*-c;e[3]=f* -b+m*-c;e[8]=d*c+g*b;e[9]=k*c+j*b;e[10]=h*c+l*b;e[11]=f*c+m*b;return e},rotateZ:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[4],j=a[5],l=a[6],m=a[7];e?a!==e&&(e[8]=a[8],e[9]=a[9],e[10]=a[10],e[11]=a[11],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*c;e[1]=k*b+j*c;e[2]=h*b+l*c;e[3]=f*b+m*c;e[4]=d*-c+g*b;e[5]=k*-c+j*b;e[6]=h*-c+l*b;e[7]=f*-c+m*b;return e},frustum:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2*d/f;h[1]=0; -h[2]=0;h[3]=0;h[4]=0;h[5]=2*d/g;h[6]=0;h[7]=0;h[8]=(b+a)/f;h[9]=(c+e)/g;h[10]=-(k+d)/j;h[11]=-1;h[12]=0;h[13]=0;h[14]=-(2*k*d)/j;h[15]=0;return h},perspective:function(a,b,e,c,d){a=e*Math.tan(a*Math.PI/360);b*=a;return y.frustum(-b,b,-a,a,e,c,d)},ortho:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2/f;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/g;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/j;h[11]=0;h[12]=-(a+b)/f;h[13]=-(c+e)/g;h[14]=-(k+d)/j;h[15]=1;return h},lookAt:function(a,b,e,c){c|| -(c=y.create());var d,k,h,f,g,j,l,m,n=a[0],p=a[1];a=a[2];h=e[0];f=e[1];k=e[2];l=b[0];e=b[1];d=b[2];if(n===l&&p===e&&a===d)return y.identity(c);b=n-l;e=p-e;l=a-d;m=1/Math.sqrt(b*b+e*e+l*l);b*=m;e*=m;l*=m;d=f*l-k*e;k=k*b-h*l;h=h*e-f*b;(m=Math.sqrt(d*d+k*k+h*h))?(m=1/m,d*=m,k*=m,h*=m):h=k=d=0;f=e*h-l*k;g=l*d-b*h;j=b*k-e*d;(m=Math.sqrt(f*f+g*g+j*j))?(m=1/m,f*=m,g*=m,j*=m):j=g=f=0;c[0]=d;c[1]=f;c[2]=b;c[3]=0;c[4]=k;c[5]=g;c[6]=e;c[7]=0;c[8]=h;c[9]=j;c[10]=l;c[11]=0;c[12]=-(d*n+k*p+h*a);c[13]=-(f*n+g*p+ -j*a);c[14]=-(b*n+e*p+l*a);c[15]=1;return c},fromRotationTranslation:function(a,b,e){e||(e=y.create());var c=a[0],d=a[1],k=a[2],h=a[3],f=c+c,g=d+d,j=k+k;a=c*f;var l=c*g,c=c*j,m=d*g,d=d*j,k=k*j,f=h*f,g=h*g,h=h*j;e[0]=1-(m+k);e[1]=l+h;e[2]=c-g;e[3]=0;e[4]=l-h;e[5]=1-(a+k);e[6]=d+f;e[7]=0;e[8]=c+g;e[9]=d-f;e[10]=1-(a+m);e[11]=0;e[12]=b[0];e[13]=b[1];e[14]=b[2];e[15]=1;return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ -a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},s={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,e,c){var d=new l(4);d[0]=a;d[1]=b;d[2]=e;d[3]=c;return d},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=s.create()); -a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},O=s.identity();s.calculateW=function(a,b){var e=a[0],c=a[1],d=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d)),a;b[0]=e;b[1]=c;b[2]=d;b[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d));return b};s.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};s.inverse=function(a,b){var e=a[0],c=a[1],d=a[2],f=a[3],e=(e=e*e+c*c+d*d+f*f)?1/e:0;if(!b||a===b)return a[0]*=-e,a[1]*=-e,a[2]*=-e,a[3]*=e,a;b[0]=-a[0]*e;b[1]=-a[1]*e;b[2]=-a[2]*e;b[3]=a[3]*e; -return b};s.conjugate=function(a,b){if(!b||a===b)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};s.length=function(a){var b=a[0],e=a[1],c=a[2];a=a[3];return Math.sqrt(b*b+e*e+c*c+a*a)};s.normalize=function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],f=a[3],h=Math.sqrt(e*e+c*c+d*d+f*f);if(0===h)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;h=1/h;b[0]=e*h;b[1]=c*h;b[2]=d*h;b[3]=f*h;return b};s.add=function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+= -b[3],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];e[3]=a[3]+b[3];return e};s.multiply=function(a,b,e){e||(e=a);var c=a[0],d=a[1],f=a[2];a=a[3];var h=b[0],g=b[1],j=b[2];b=b[3];e[0]=c*b+a*h+d*j-f*g;e[1]=d*b+a*g+f*h-c*j;e[2]=f*b+a*j+c*g-d*h;e[3]=a*b-c*h-d*g-f*j;return e};s.multiplyVec3=function(a,b,e){e||(e=b);var c=b[0],d=b[1],f=b[2];b=a[0];var h=a[1],g=a[2];a=a[3];var j=a*c+h*f-g*d,l=a*d+g*c-b*f,m=a*f+b*d-h*c,c=-b*c-h*d-g*f;e[0]=j*a+c*-b+l*-g-m*-h;e[1]=l*a+c*-h+m*-b-j*-g;e[2]=m*a+c*-g+j*-h-l*-b; -return e};s.scale=function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a[3]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;e[3]=a[3]*b;return e};s.toMat3=function(a,b){b||(b=F.create());var e=a[0],c=a[1],d=a[2],f=a[3],h=e+e,g=c+c,j=d+d,l=e*h,m=e*g,e=e*j,n=c*g,c=c*j,d=d*j,h=f*h,g=f*g,f=f*j;b[0]=1-(n+d);b[1]=m+f;b[2]=e-g;b[3]=m-f;b[4]=1-(l+d);b[5]=c+h;b[6]=e+g;b[7]=c-h;b[8]=1-(l+n);return b};s.toMat4=function(a,b){b||(b=y.create());var e=a[0],c=a[1],d=a[2],f=a[3],g=e+e,j=c+c,l=d+d,m=e*g,n=e*j,e=e* -l,p=c*j,c=c*l,d=d*l,g=f*g,j=f*j,f=f*l;b[0]=1-(p+d);b[1]=n+f;b[2]=e-j;b[3]=0;b[4]=n-f;b[5]=1-(m+d);b[6]=c+g;b[7]=0;b[8]=e+j;b[9]=c-g;b[10]=1-(m+p);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};s.slerp=function(a,b,c,d){d||(d=a);var f=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],g,h;if(1<=Math.abs(f))return d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d;g=Math.acos(f);h=Math.sqrt(1-f*f);if(0.001>Math.abs(h))return d[0]=0.5*a[0]+0.5*b[0],d[1]=0.5*a[1]+0.5*b[1],d[2]=0.5*a[2]+0.5*b[2],d[3]=0.5*a[3]+ -0.5*b[3],d;f=Math.sin((1-c)*g)/h;c=Math.sin(c*g)/h;d[0]=a[0]*f+b[0]*c;d[1]=a[1]*f+b[1]*c;d[2]=a[2]*f+b[2]*c;d[3]=a[3]*f+b[3]*c;return d};s.fromRotationMatrix=function(a,b){b||(b=s.create());var c=a[0]+a[4]+a[8],d;if(0a[0]&&(c=1);a[8]>a[3*c+c]&&(c=2);var f=d[c],g=d[f];d=Math.sqrt(a[3*c+c]-a[3*f+f]-a[3*g+g]+1);b[c]=0.5*d;d= -0.5/d;b[3]=(a[3*g+f]-a[3*f+g])*d;b[f]=(a[3*f+c]+a[3*c+f])*d;b[g]=(a[3*g+c]+a[3*c+g])*d}return b};F.toQuat4=s.fromRotationMatrix;var D=F.create();s.fromAxes=function(a,b,c,d){D[0]=b[0];D[3]=b[1];D[6]=b[2];D[1]=c[0];D[4]=c[1];D[7]=c[2];D[2]=a[0];D[5]=a[1];D[8]=a[2];return s.fromRotationMatrix(D,d)};s.identity=function(a){a||(a=s.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};s.fromAngleAxis=function(a,b,c){c||(c=s.create());a*=0.5;var d=Math.sin(a);c[3]=Math.cos(a);c[0]=d*b[0];c[1]=d*b[1];c[2]=d*b[2]; -return c};s.toAngleAxis=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); -b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 -Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],f=a[2],g=a[3],h=c*g-f*d;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-d*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, -b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];c[0]=d*b[0]+f*b[2];c[1]=d*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=d*b+f*h;c[1]=d*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var d=b[0];b=b[1];c[0]=d*a[0]+b*a[1];c[1]=d*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var d=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=d*b;c[2]=f*h;c[3]= -g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,d){var f=new l(4);f[0]=a;f[1]=b;f[2]=c;f[3]=d;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, -b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| -(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)},squaredLength:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};c&&(c.glMatrixArrayType=l,c.MatrixArray=l,c.setMatrixArrayType=d,c.determineMatrixArrayType= -f,c.glMath=g,c.vec2=M,c.vec3=j,c.vec4=N,c.mat2=L,c.mat3=F,c.mat4=y,c.quat4=s);return{glMatrixArrayType:l,MatrixArray:l,setMatrixArrayType:d,determineMatrixArrayType:f,glMath:g,vec2:M,vec3:j,vec4:N,mat2:L,mat3:F,mat4:y,quat4:s}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * vColor;","}"]; -PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"]; -PIXI.CompileVertexShader=function(c,d){for(var f="",g=0;g>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/examples/bunny benchmark/index.html b/examples/bunny benchmark/index.html index 7c5521b..95972c4 100644 --- a/examples/bunny benchmark/index.html +++ b/examples/bunny benchmark/index.html @@ -9,9 +9,10 @@ +
    Click to add more bunnys! Let me know how many you get on screen here @doormat23
    - + diff --git a/examples/bunny benchmark/js/bunnyBenchMark.js b/examples/bunny benchmark/js/bunnyBenchMark.js index a3154eb..c3c8ec5 100644 --- a/examples/bunny benchmark/js/bunnyBenchMark.js +++ b/examples/bunny benchmark/js/bunnyBenchMark.js @@ -22,18 +22,13 @@ var count = 0; var container; +var detail; + function onReady() { - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() + detail = document.getElementById("pixi"); - if(webgl) - { - renderer = new PIXI.WebGLRenderer(); - } - else - { - renderer = new PIXI.CanvasRenderer(480, 320); - } + renderer = PIXI.autoDetectRenderer(); stage = new PIXI.Stage; @@ -46,7 +41,7 @@ stats.domElement.style.top = "0px"; requestAnimFrame(update); - wabbitTexture = new PIXI.Texture("wabbit.png") + wabbitTexture = new PIXI.Texture.fromImage("wabbit.png") counter = document.createElement("div"); counter.className = "counter"; @@ -55,7 +50,6 @@ count = startBunnyCount; counter.innerHTML = count + " BUNNIES"; - container = new PIXI.DisplayObjectContainer(); stage.addChild(container); @@ -114,7 +108,9 @@ minX = 0; maxY = height; minY = 0; - + + detail.style.left = width - 204 + "px"; + detail.style.top = height - 100 + "px"; renderer.resize(width, height); } @@ -126,17 +122,17 @@ { // add 10 at a time :) - for (var i = 0; i < 2; i++) + for (var i = 0; i < 10; i++) { - var bunny = new PIXI.Sprite(wabbitTexture, {x:0, y:0, width:26, height:37}); + var bunny = new PIXI.Sprite(wabbitTexture); bunny.speedX = Math.random() * 10; bunny.speedY = (Math.random() * 10) - 5; bunny.anchor.x = 0.5; bunny.anchor.y = 1; - bunny.alpha = 0.3 + Math.random() * 0.7; + //bunny.alpha = 0.3 + Math.random() * 0.7; bunnys.push(bunny); - bunny.rotation = Math.random() - 0.5; + //bunny.rotation = Math.random() - 0.5; container.addChild(bunny); count++; diff --git a/examples/bunny benchmark/js/pixi.js b/examples/bunny benchmark/js/pixi.js new file mode 100644 index 0000000..65add09 --- /dev/null +++ b/examples/bunny benchmark/js/pixi.js @@ -0,0 +1,110 @@ +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, +d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* +j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= +a[0]-d[0],c=a[1]-d[1];a=a[2]-d[2];d=Math.sqrt(b*b+c*c+a*a);if(!d)return j[0]=0,j[1]=0,j[2]=0,j;d=1/d;j[0]=b*d;j[1]=c*d;j[2]=a*d;return j},lerp:function(a,d,j,b){b||(b=a);b[0]=a[0]+j*(d[0]-a[0]);b[1]=a[1]+j*(d[1]-a[1]);b[2]=a[2]+j*(d[2]-a[2]);return b},dist:function(a,d){var j=d[0]-a[0],b=d[1]-a[1],c=d[2]-a[2];return Math.sqrt(j*j+b*b+c*c)}},p=null,q=new k(4);l.unproject=function(a,d,j,b,c){c||(c=a);p||(p=t.create());var e=p;q[0]=2*(a[0]-b[0])/b[2]-1;q[1]=2*(a[1]-b[1])/b[3]-1;q[2]=2*a[2]-1;q[3]=1; +t.multiply(j,d,e);if(!t.inverse(e))return null;t.multiplyVec4(e,q);if(0===q[3])return null;c[0]=q[0]/q[3];c[1]=q[1]/q[3];c[2]=q[2]/q[3];return c};var C=l.createFrom(1,0,0),F=l.createFrom(0,1,0),u=l.createFrom(0,0,1),w=l.create();l.rotationTo=function(a,d,j){j||(j=m.create());var b=l.dot(a,d);if(1<=b)m.set(H,j);else if(-0.999999>b)l.cross(C,a,w),1E-6>l.length(w)&&l.cross(F,a,w),1E-6>l.length(w)&&l.cross(u,a,w),l.normalize(w),m.fromAngleAxis(Math.PI,w,j);else{var b=Math.sqrt(2*(1+b)),c=1/b;l.cross(a, +d,w);j[0]=w[0]*c;j[1]=w[1]*c;j[2]=w[2]*c;j[3]=0.5*b;m.normalize(j)}1j[3]&&(j[3]=-1);return j};l.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var x={create:function(a){var d=new k(9);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8]):d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=0;return d},createFrom:function(a,d,j,b,c,e,n,f,E){var s=new k(9);s[0]=a;s[1]=d;s[2]=j;s[3]=b;s[4]=c;s[5]=e;s[6]=n;s[7]=f;s[8]=E;return s},determinant:function(a){var d= +a[3],j=a[4],b=a[5],c=a[6],e=a[7],n=a[8];return a[0]*(n*j-b*e)+a[1]*(-n*d+b*c)+a[2]*(e*d-j*c)},inverse:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[3],n=a[4],f=a[5],E=a[6],s=a[7],I=a[8],g=I*n-f*s,h=-I*e+f*E,k=s*e-n*E,r=j*g+b*h+c*k;if(!r)return null;r=1/r;d||(d=x.create());d[0]=g*r;d[1]=(-I*b+c*s)*r;d[2]=(f*b-c*n)*r;d[3]=h*r;d[4]=(I*j-c*E)*r;d[5]=(-f*j+c*e)*r;d[6]=k*r;d[7]=(-s*j+b*E)*r;d[8]=(n*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],D=a[4],E=a[5],s=a[6],I= +a[7];a=a[8];var g=d[0],h=d[1],k=d[2],r=d[3],m=d[4],l=d[5],q=d[6],v=d[7];d=d[8];j[0]=g*b+h*f+k*s;j[1]=g*c+h*D+k*I;j[2]=g*e+h*E+k*a;j[3]=r*b+m*f+l*s;j[4]=r*c+m*D+l*I;j[5]=r*e+m*E+l*a;j[6]=q*b+v*f+d*s;j[7]=q*c+v*D+d*I;j[8]=q*e+v*E+d*a;return j},multiplyVec2:function(a,d,j){j||(j=d);var b=d[0];d=d[1];j[0]=b*a[0]+d*a[3]+a[6];j[1]=b*a[1]+d*a[4]+a[7];return j},multiplyVec3:function(a,d,j){j||(j=d);var b=d[0],c=d[1];d=d[2];j[0]=b*a[0]+c*a[3]+d*a[6];j[1]=b*a[1]+c*a[4]+d*a[7];j[2]=b*a[2]+c*a[5]+d*a[8];return j}, +set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])},identity:function(a){a||(a=x.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, +d){if(!d||a===d){var j=a[1],b=a[2],c=a[5];a[1]=a[3];a[2]=a[6];a[3]=j;a[5]=a[7];a[6]=b;a[7]=c;return a}d[0]=a[0];d[1]=a[3];d[2]=a[6];d[3]=a[1];d[4]=a[4];d[5]=a[7];d[6]=a[2];d[7]=a[5];d[8]=a[8];return d},toMat4:function(a,d){d||(d=t.create());d[15]=1;d[14]=0;d[13]=0;d[12]=0;d[11]=0;d[10]=a[8];d[9]=a[7];d[8]=a[6];d[7]=0;d[6]=a[5];d[5]=a[4];d[4]=a[3];d[3]=0;d[2]=a[2];d[1]=a[1];d[0]=a[0];return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ +a[8]+"]"}},t={create:function(a){var d=new k(16);a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8],d[9]=a[9],d[10]=a[10],d[11]=a[11],d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d},createFrom:function(a,d,j,b,c,e,f,D,E,s,g,h,m,l,r,q){var A=new k(16);A[0]=a;A[1]=d;A[2]=j;A[3]=b;A[4]=c;A[5]=e;A[6]=f;A[7]=D;A[8]=E;A[9]=s;A[10]=g;A[11]=h;A[12]=m;A[13]=l;A[14]=r;A[15]=q;return A},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4]; +d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=a[12];d[13]=a[13];d[14]=a[14];d[15]=a[15];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])&&1E-6>Math.abs(a[9]-d[9])&&1E-6>Math.abs(a[10]-d[10])&&1E-6>Math.abs(a[11]-d[11])&&1E-6>Math.abs(a[12]- +d[12])&&1E-6>Math.abs(a[13]-d[13])&&1E-6>Math.abs(a[14]-d[14])&&1E-6>Math.abs(a[15]-d[15])},identity:function(a){a||(a=t.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,d){if(!d||a===d){var j=a[1],b=a[2],c=a[3],e=a[6],f=a[7],D=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=j;a[6]=a[9];a[7]=a[13];a[8]=b;a[9]=e;a[11]=a[14];a[12]=c;a[13]=f;a[14]=D;return a}d[0]=a[0];d[1]=a[4];d[2]=a[8];d[3]=a[12]; +d[4]=a[1];d[5]=a[5];d[6]=a[9];d[7]=a[13];d[8]=a[2];d[9]=a[6];d[10]=a[10];d[11]=a[14];d[12]=a[3];d[13]=a[7];d[14]=a[11];d[15]=a[15];return d},determinant:function(a){var d=a[0],j=a[1],b=a[2],c=a[3],e=a[4],f=a[5],D=a[6],E=a[7],s=a[8],g=a[9],h=a[10],k=a[11],m=a[12],r=a[13],l=a[14];a=a[15];return m*g*D*c-s*r*D*c-m*f*h*c+e*r*h*c+s*f*l*c-e*g*l*c-m*g*b*E+s*r*b*E+m*j*h*E-d*r*h*E-s*j*l*E+d*g*l*E+m*f*b*k-e*r*b*k-m*j*D*k+d*r*D*k+e*j*l*k-d*f*l*k-s*f*b*a+e*g*b*a+s*j*D*a-d*g*D*a-e*j*h*a+d*f*h*a},inverse:function(a, +d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=a[3],f=a[4],D=a[5],E=a[6],s=a[7],g=a[8],h=a[9],k=a[10],m=a[11],r=a[12],l=a[13],A=a[14],q=a[15],v=j*D-b*f,J=j*E-c*f,y=j*s-e*f,z=b*E-c*D,t=b*s-e*D,u=c*s-e*E,p=g*l-h*r,w=g*A-k*r,x=g*q-m*r,B=h*A-k*l,C=h*q-m*l,F=k*q-m*A,G=v*F-J*C+y*B+z*x-t*w+u*p;if(!G)return null;G=1/G;d[0]=(D*F-E*C+s*B)*G;d[1]=(-b*F+c*C-e*B)*G;d[2]=(l*u-A*t+q*z)*G;d[3]=(-h*u+k*t-m*z)*G;d[4]=(-f*F+E*x-s*w)*G;d[5]=(j*F-c*x+e*w)*G;d[6]=(-r*u+A*y-q*J)*G;d[7]=(g*u-k*y+m*J)*G;d[8]=(f*C-D*x+s*p)*G;d[9]= +(-j*C+b*x-e*p)*G;d[10]=(r*t-l*y+q*v)*G;d[11]=(-g*t+h*y-m*v)*G;d[12]=(-f*B+D*w-E*p)*G;d[13]=(j*B-b*w+c*p)*G;d[14]=(-r*z+l*J-A*v)*G;d[15]=(g*z-h*J+k*v)*G;return d},toRotationMat:function(a,d){d||(d=t.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d},toMat3:function(a,d){d||(d=x.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[4];d[4]=a[5];d[5]=a[6];d[6]=a[8];d[7]=a[9];d[8]=a[10]; +return d},toInverseMat3:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[4],f=a[5],D=a[6],g=a[8],s=a[9],h=a[10],k=h*f-D*s,m=-h*e+D*g,l=s*e-f*g,r=j*k+b*m+c*l;if(!r)return null;r=1/r;d||(d=x.create());d[0]=k*r;d[1]=(-h*b+c*s)*r;d[2]=(D*b-c*f)*r;d[3]=m*r;d[4]=(h*j-c*g)*r;d[5]=(-D*j+c*e)*r;d[6]=l*r;d[7]=(-s*j+b*g)*r;d[8]=(f*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],s=a[6],k=a[7],m=a[8],l=a[9],q=a[10],r=a[11],t=a[12],A=a[13],u=a[14];a=a[15];var v=d[0], +p=d[1],y=d[2],z=d[3];j[0]=v*b+p*g+y*m+z*t;j[1]=v*c+p*h+y*l+z*A;j[2]=v*e+p*s+y*q+z*u;j[3]=v*f+p*k+y*r+z*a;v=d[4];p=d[5];y=d[6];z=d[7];j[4]=v*b+p*g+y*m+z*t;j[5]=v*c+p*h+y*l+z*A;j[6]=v*e+p*s+y*q+z*u;j[7]=v*f+p*k+y*r+z*a;v=d[8];p=d[9];y=d[10];z=d[11];j[8]=v*b+p*g+y*m+z*t;j[9]=v*c+p*h+y*l+z*A;j[10]=v*e+p*s+y*q+z*u;j[11]=v*f+p*k+y*r+z*a;v=d[12];p=d[13];y=d[14];z=d[15];j[12]=v*b+p*g+y*m+z*t;j[13]=v*c+p*h+y*l+z*A;j[14]=v*e+p*s+y*q+z*u;j[15]=v*f+p*k+y*r+z*a;return j},multiplyVec3:function(a,d,b){b||(b=d); +var c=d[0],e=d[1];d=d[2];b[0]=a[0]*c+a[4]*e+a[8]*d+a[12];b[1]=a[1]*c+a[5]*e+a[9]*d+a[13];b[2]=a[2]*c+a[6]*e+a[10]*d+a[14];return b},multiplyVec4:function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=d[3];b[0]=a[0]*c+a[4]*e+a[8]*f+a[12]*d;b[1]=a[1]*c+a[5]*e+a[9]*f+a[13]*d;b[2]=a[2]*c+a[6]*e+a[10]*f+a[14]*d;b[3]=a[3]*c+a[7]*e+a[11]*f+a[15]*d;return b},translate:function(a,d,b){var c=d[0],e=d[1];d=d[2];var f,n,g,h,s,k,m,l,p,r,q,t;if(!b||a===b)return a[12]=a[0]*c+a[4]*e+a[8]*d+a[12],a[13]=a[1]*c+a[5]*e+ +a[9]*d+a[13],a[14]=a[2]*c+a[6]*e+a[10]*d+a[14],a[15]=a[3]*c+a[7]*e+a[11]*d+a[15],a;f=a[0];n=a[1];g=a[2];h=a[3];s=a[4];k=a[5];m=a[6];l=a[7];p=a[8];r=a[9];q=a[10];t=a[11];b[0]=f;b[1]=n;b[2]=g;b[3]=h;b[4]=s;b[5]=k;b[6]=m;b[7]=l;b[8]=p;b[9]=r;b[10]=q;b[11]=t;b[12]=f*c+s*e+p*d+a[12];b[13]=n*c+k*e+r*d+a[13];b[14]=g*c+m*e+q*d+a[14];b[15]=h*c+l*e+t*d+a[15];return b},scale:function(a,d,b){var c=d[0],e=d[1];d=d[2];if(!b||a===b)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=d,a[9]*= +d,a[10]*=d,a[11]*=d,a;b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[7]=a[7]*e;b[8]=a[8]*d;b[9]=a[9]*d;b[10]=a[10]*d;b[11]=a[11]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},rotate:function(a,d,b,c){var e=b[0],f=b[1];b=b[2];var n=Math.sqrt(e*e+f*f+b*b),g,h,k,m,l,p,q,r,t,u,w,v,x,y,z,B,C,F,H,K;if(!n)return null;1!==n&&(n=1/n,e*=n,f*=n,b*=n);g=Math.sin(d);h=Math.cos(d);k=1-h;d=a[0];n=a[1];m=a[2];l=a[3];p=a[4];q=a[5];r=a[6];t=a[7];u=a[8];w=a[9];v= +a[10];x=a[11];y=e*e*k+h;z=f*e*k+b*g;B=b*e*k-f*g;C=e*f*k-b*g;F=f*f*k+h;H=b*f*k+e*g;K=e*b*k+f*g;e=f*b*k-e*g;f=b*b*k+h;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=d*y+p*z+u*B;c[1]=n*y+q*z+w*B;c[2]=m*y+r*z+v*B;c[3]=l*y+t*z+x*B;c[4]=d*C+p*F+u*H;c[5]=n*C+q*F+w*H;c[6]=m*C+r*F+v*H;c[7]=l*C+t*F+x*H;c[8]=d*K+p*e+u*f;c[9]=n*K+q*e+w*f;c[10]=m*K+r*e+v*f;c[11]=l*K+t*e+x*f;return c},rotateX:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[4],f=a[5],n=a[6],g=a[7],h=a[8],k=a[9],m=a[10], +l=a[11];b?a!==b&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[4]=e*d+h*c;b[5]=f*d+k*c;b[6]=n*d+m*c;b[7]=g*d+l*c;b[8]=e*-c+h*d;b[9]=f*-c+k*d;b[10]=n*-c+m*d;b[11]=g*-c+l*d;return b},rotateY:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[8],k=a[9],m=a[10],l=a[11];b?a!==b&&(b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*-c;b[1]=f*d+k*-c;b[2]=n*d+m*-c;b[3]=g* +d+l*-c;b[8]=e*c+h*d;b[9]=f*c+k*d;b[10]=n*c+m*d;b[11]=g*c+l*d;return b},rotateZ:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[4],k=a[5],m=a[6],l=a[7];b?a!==b&&(b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*c;b[1]=f*d+k*c;b[2]=n*d+m*c;b[3]=g*d+l*c;b[4]=e*-c+h*d;b[5]=f*-c+k*d;b[6]=n*-c+m*d;b[7]=g*-c+l*d;return b},frustum:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2*e/g;n[1]=0; +n[2]=0;n[3]=0;n[4]=0;n[5]=2*e/h;n[6]=0;n[7]=0;n[8]=(d+a)/g;n[9]=(c+b)/h;n[10]=-(f+e)/k;n[11]=-1;n[12]=0;n[13]=0;n[14]=-(2*f*e)/k;n[15]=0;return n},perspective:function(a,d,b,c,e){a=b*Math.tan(a*Math.PI/360);d*=a;return t.frustum(-d,d,-a,a,b,c,e)},ortho:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2/g;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=2/h;n[6]=0;n[7]=0;n[8]=0;n[9]=0;n[10]=-2/k;n[11]=0;n[12]=-(a+d)/g;n[13]=-(c+b)/h;n[14]=-(f+e)/k;n[15]=1;return n},lookAt:function(a,d,b,c){c|| +(c=t.create());var e,f,n,g,h,k,m,l,p=a[0],q=a[1];a=a[2];n=b[0];g=b[1];f=b[2];m=d[0];b=d[1];e=d[2];if(p===m&&q===b&&a===e)return t.identity(c);d=p-m;b=q-b;m=a-e;l=1/Math.sqrt(d*d+b*b+m*m);d*=l;b*=l;m*=l;e=g*m-f*b;f=f*d-n*m;n=n*b-g*d;(l=Math.sqrt(e*e+f*f+n*n))?(l=1/l,e*=l,f*=l,n*=l):n=f=e=0;g=b*n-m*f;h=m*e-d*n;k=d*f-b*e;(l=Math.sqrt(g*g+h*h+k*k))?(l=1/l,g*=l,h*=l,k*=l):k=h=g=0;c[0]=e;c[1]=g;c[2]=d;c[3]=0;c[4]=f;c[5]=h;c[6]=b;c[7]=0;c[8]=n;c[9]=k;c[10]=m;c[11]=0;c[12]=-(e*p+f*q+n*a);c[13]=-(g*p+h*q+ +k*a);c[14]=-(d*p+b*q+m*a);c[15]=1;return c},fromRotationTranslation:function(a,d,b){b||(b=t.create());var c=a[0],e=a[1],f=a[2],n=a[3],g=c+c,h=e+e,k=f+f;a=c*g;var l=c*h,c=c*k,m=e*h,e=e*k,f=f*k,g=n*g,h=n*h,n=n*k;b[0]=1-(m+f);b[1]=l+n;b[2]=c-h;b[3]=0;b[4]=l-n;b[5]=1-(a+f);b[6]=e+g;b[7]=0;b[8]=c+h;b[9]=e-g;b[10]=1-(a+m);b[11]=0;b[12]=d[0];b[13]=d[1];b[14]=d[2];b[15]=1;return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ +a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},m={create:function(a){var d=new k(4);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]):d[0]=d[1]=d[2]=d[3]=0;return d},createFrom:function(a,d,b,c){var e=new k(4);e[0]=a;e[1]=d;e[2]=b;e[3]=c;return e},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])},identity:function(a){a||(a=m.create()); +a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},H=m.identity();m.calculateW=function(a,d){var b=a[0],c=a[1],e=a[2];if(!d||a===d)return a[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e)),a;d[0]=b;d[1]=c;d[2]=e;d[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e));return d};m.dot=function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3]};m.inverse=function(a,d){var b=a[0],c=a[1],e=a[2],f=a[3],b=(b=b*b+c*c+e*e+f*f)?1/b:0;if(!d||a===d)return a[0]*=-b,a[1]*=-b,a[2]*=-b,a[3]*=b,a;d[0]=-a[0]*b;d[1]=-a[1]*b;d[2]=-a[2]*b;d[3]=a[3]*b; +return d};m.conjugate=function(a,d){if(!d||a===d)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=a[3];return d};m.length=function(a){var d=a[0],b=a[1],c=a[2];a=a[3];return Math.sqrt(d*d+b*b+c*c+a*a)};m.normalize=function(a,d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=Math.sqrt(b*b+c*c+e*e+f*f);if(0===g)return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d;g=1/g;d[0]=b*g;d[1]=c*g;d[2]=e*g;d[3]=f*g;return d};m.add=function(a,d,b){if(!b||a===b)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a[3]+= +d[3],a;b[0]=a[0]+d[0];b[1]=a[1]+d[1];b[2]=a[2]+d[2];b[3]=a[3]+d[3];return b};m.multiply=function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2];a=a[3];var g=d[0],h=d[1],k=d[2];d=d[3];b[0]=c*d+a*g+e*k-f*h;b[1]=e*d+a*h+f*g-c*k;b[2]=f*d+a*k+c*h-e*g;b[3]=a*d-c*g-e*h-f*k;return b};m.multiplyVec3=function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=a[0];var g=a[1],h=a[2];a=a[3];var k=a*c+g*f-h*e,l=a*e+h*c-d*f,m=a*f+d*e-g*c,c=-d*c-g*e-h*f;b[0]=k*a+c*-d+l*-h-m*-g;b[1]=l*a+c*-g+m*-d-k*-h;b[2]=m*a+c*-h+k*-g-l*-d; +return b};m.scale=function(a,d,b){if(!b||a===b)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a;b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[3]=a[3]*d;return b};m.toMat3=function(a,d){d||(d=x.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b*k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=m-f;d[4]=1-(l+e);d[5]=c+g;d[6]=b+h;d[7]=c-g;d[8]=1-(l+p);return d};m.toMat4=function(a,d){d||(d=t.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b* +k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=0;d[4]=m-f;d[5]=1-(l+e);d[6]=c+g;d[7]=0;d[8]=b+h;d[9]=c-g;d[10]=1-(l+p);d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d};m.slerp=function(a,d,b,c){c||(c=a);var e=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3],f,g;if(1<=Math.abs(e))return c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]),c;f=Math.acos(e);g=Math.sqrt(1-e*e);if(0.0010>Math.abs(g))return c[0]=0.5*a[0]+0.5*d[0],c[1]=0.5*a[1]+0.5*d[1],c[2]=0.5*a[2]+0.5*d[2],c[3]=0.5*a[3]+ +0.5*d[3],c;e=Math.sin((1-b)*f)/g;b=Math.sin(b*f)/g;c[0]=a[0]*e+d[0]*b;c[1]=a[1]*e+d[1]*b;c[2]=a[2]*e+d[2]*b;c[3]=a[3]*e+d[3]*b;return c};m.fromRotationMatrix=function(a,d){d||(d=m.create());var b=a[0]+a[4]+a[8],c;if(0a[0]&&(b=1);a[8]>a[3*b+b]&&(b=2);var e=c[b],f=c[e];c=Math.sqrt(a[3*b+b]-a[3*e+e]-a[3*f+f]+1);d[b]=0.5*c;c= +0.5/c;d[3]=(a[3*f+e]-a[3*e+f])*c;d[e]=(a[3*e+b]+a[3*b+e])*c;d[f]=(a[3*f+b]+a[3*b+f])*c}return d};x.toQuat4=m.fromRotationMatrix;var B=x.create();m.fromAxes=function(a,d,b,c){B[0]=d[0];B[3]=d[1];B[6]=d[2];B[1]=b[0];B[4]=b[1];B[7]=b[2];B[2]=a[0];B[5]=a[1];B[8]=a[2];return m.fromRotationMatrix(B,c)};m.identity=function(a){a||(a=m.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};m.fromAngleAxis=function(a,d,b){b||(b=m.create());a*=0.5;var c=Math.sin(a);b[3]=Math.cos(a);b[0]=c*d[0];b[1]=c*d[1];b[2]=c*d[2]; +return b};m.toAngleAxis=function(a,d){d||(d=a);var b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); +b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 +Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],e=a[1],f=a[2],g=a[3],h=c*g-f*e;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-e*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, +b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];c[0]=e*b[0]+f*b[2];c[1]=e*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=e*b+f*h;c[1]=e*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var e=b[0];b=b[1];c[0]=e*a[0]+b*a[1];c[1]=e*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var e=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=e*b;c[2]=f*h;c[3]= +g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, +b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| +(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= +f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; +PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; +PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l>1);var b=m[0];return b*(1.5-0.5*a*b*b)}}else g.invsqrt=function(a){return 1/Math.sqrt(a)}; -var l=null;f();var j={create:function(a){var b=new l(3);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0;return b},createFrom:function(a,b,e){var c=new l(3);c[0]=a;c[1]=b;c[2]=e;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])},add:function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];return e},subtract:function(a, -b,e){if(!e||a===e)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];return e},multiply:function(a,b,e){if(!e||a===e)return a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a;e[0]=a[0]*b[0];e[1]=a[1]*b[1];e[2]=a[2]*b[2];return e},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;return e},normalize:function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=Math.sqrt(e* -e+c*c+d*d);if(!k)return b[0]=0,b[1]=0,b[2]=0,b;if(1===k)return b[0]=e,b[1]=c,b[2]=d,b;k=1/k;b[0]=e*k;b[1]=c*k;b[2]=d*k;return b},cross:function(a,b,e){e||(e=a);var c=a[0],d=a[1];a=a[2];var k=b[0],h=b[1];b=b[2];e[0]=d*b-a*h;e[1]=a*k-c*b;e[2]=c*h-d*k;return e},length:function(a){var b=a[0],e=a[1];a=a[2];return Math.sqrt(b*b+e*e+a*a)},squaredLength:function(a){var b=a[0],e=a[1];a=a[2];return b*b+e*e+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,b,e){e||(e=a);var c= -a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];b=Math.sqrt(c*c+d*d+a*a);if(!b)return e[0]=0,e[1]=0,e[2]=0,e;b=1/b;e[0]=c*b;e[1]=d*b;e[2]=a*b;return e},lerp:function(a,b,e,c){c||(c=a);c[0]=a[0]+e*(b[0]-a[0]);c[1]=a[1]+e*(b[1]-a[1]);c[2]=a[2]+e*(b[2]-a[2]);return c},dist:function(a,b){var e=b[0]-a[0],c=b[1]-a[1],d=b[2]-a[2];return Math.sqrt(e*e+c*c+d*d)}},x=null,n=new l(4);j.unproject=function(a,b,e,c,d){d||(d=a);x||(x=y.create());var k=x;n[0]=2*(a[0]-c[0])/c[2]-1;n[1]=2*(a[1]-c[1])/c[3]-1;n[2]=2*a[2]-1;n[3]=1; -y.multiply(e,b,k);if(!y.inverse(k))return null;y.multiplyVec4(k,n);if(0===n[3])return null;d[0]=n[0]/n[3];d[1]=n[1]/n[3];d[2]=n[2]/n[3];return d};var z=j.createFrom(1,0,0),A=j.createFrom(0,1,0),H=j.createFrom(0,0,1),C=j.create();j.rotationTo=function(a,b,e){e||(e=s.create());var c=j.dot(a,b);if(1<=c)s.set(O,e);else if(-0.999999>c)j.cross(z,a,C),1E-6>j.length(C)&&j.cross(A,a,C),1E-6>j.length(C)&&j.cross(H,a,C),j.normalize(C),s.fromAngleAxis(Math.PI,C,e);else{var c=Math.sqrt(2*(1+c)),d=1/c;j.cross(a, -b,C);e[0]=C[0]*d;e[1]=C[1]*d;e[2]=C[2]*d;e[3]=0.5*c;s.normalize(e)}1e[3]&&(e[3]=-1);return e};j.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var F={create:function(a){var b=new l(9);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0;return b},createFrom:function(a,b,e,c,d,k,h,E,K){var q=new l(9);q[0]=a;q[1]=b;q[2]=e;q[3]=c;q[4]=d;q[5]=k;q[6]=h;q[7]=E;q[8]=K;return q},determinant:function(a){var b= -a[3],e=a[4],c=a[5],d=a[6],k=a[7],h=a[8];return a[0]*(h*e-c*k)+a[1]*(-h*b+c*d)+a[2]*(k*b-e*d)},inverse:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],E=a[5],K=a[6],q=a[7],f=a[8],g=f*h-E*q,j=-f*k+E*K,J=q*k-h*K,r=e*g+c*j+d*J;if(!r)return null;r=1/r;b||(b=F.create());b[0]=g*r;b[1]=(-f*c+d*q)*r;b[2]=(E*c-d*h)*r;b[3]=j*r;b[4]=(f*e-d*K)*r;b[5]=(-E*e+d*k)*r;b[6]=J*r;b[7]=(-q*e+c*K)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],E=a[4],f=a[5],q=a[6],g= -a[7];a=a[8];var u=b[0],j=b[1],J=b[2],r=b[3],l=b[4],t=b[5],m=b[6],p=b[7];b=b[8];e[0]=u*c+j*h+J*q;e[1]=u*d+j*E+J*g;e[2]=u*k+j*f+J*a;e[3]=r*c+l*h+t*q;e[4]=r*d+l*E+t*g;e[5]=r*k+l*f+t*a;e[6]=m*c+p*h+b*q;e[7]=m*d+p*E+b*g;e[8]=m*k+p*f+b*a;return e},multiplyVec2:function(a,b,e){e||(e=b);var c=b[0];b=b[1];e[0]=c*a[0]+b*a[3]+a[6];e[1]=c*a[1]+b*a[4]+a[7];return e},multiplyVec3:function(a,b,e){e||(e=b);var c=b[0],d=b[1];b=b[2];e[0]=c*a[0]+d*a[3]+b*a[6];e[1]=c*a[1]+d*a[4]+b*a[7];e[2]=c*a[2]+d*a[5]+b*a[8];return e}, -set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])},identity:function(a){a||(a=F.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, -b){if(!b||a===b){var e=a[1],c=a[2],d=a[5];a[1]=a[3];a[2]=a[6];a[3]=e;a[5]=a[7];a[6]=c;a[7]=d;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]=a[8];return b},toMat4:function(a,b){b||(b=y.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ -a[8]+"]"}},y={create:function(a){var b=new l(16);a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]);return b},createFrom:function(a,b,e,c,d,k,h,E,f,q,g,u,j,J,r,m){var t=new l(16);t[0]=a;t[1]=b;t[2]=e;t[3]=c;t[4]=d;t[5]=k;t[6]=h;t[7]=E;t[8]=f;t[9]=q;t[10]=g;t[11]=u;t[12]=j;t[13]=J;t[14]=r;t[15]=m;return t},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4]; -b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])&&1E-6>Math.abs(a[9]-b[9])&&1E-6>Math.abs(a[10]-b[10])&&1E-6>Math.abs(a[11]-b[11])&&1E-6>Math.abs(a[12]- -b[12])&&1E-6>Math.abs(a[13]-b[13])&&1E-6>Math.abs(a[14]-b[14])&&1E-6>Math.abs(a[15]-b[15])},identity:function(a){a||(a=y.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){var e=a[1],c=a[2],d=a[3],k=a[6],h=a[7],E=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=e;a[6]=a[9];a[7]=a[13];a[8]=c;a[9]=k;a[11]=a[14];a[12]=d;a[13]=h;a[14]=E;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12]; -b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b=a[0],e=a[1],c=a[2],d=a[3],k=a[4],h=a[5],E=a[6],f=a[7],g=a[8],I=a[9],u=a[10],j=a[11],l=a[12],r=a[13],m=a[14];a=a[15];return l*I*E*d-g*r*E*d-l*h*u*d+k*r*u*d+g*h*m*d-k*I*m*d-l*I*c*f+g*r*c*f+l*e*u*f-b*r*u*f-g*e*m*f+b*I*m*f+l*h*c*j-k*r*c*j-l*e*E*j+b*r*E*j+k*e*m*j-b*h*m*j-g*h*c*a+k*I*c*a+g*e*E*a-b*I*E*a-k*e*u*a+b*h*u*a},inverse:function(a, -b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],f=a[5],g=a[6],q=a[7],I=a[8],u=a[9],j=a[10],l=a[11],r=a[12],m=a[13],t=a[14],p=a[15],s=e*f-c*h,n=e*g-d*h,v=e*q-k*h,w=c*g-d*f,x=c*q-k*f,y=d*q-k*g,z=I*m-u*r,A=I*t-j*r,C=I*p-l*r,D=u*t-j*m,F=u*p-l*m,H=j*p-l*t,G=s*H-n*F+v*D+w*C-x*A+y*z;if(!G)return null;G=1/G;b[0]=(f*H-g*F+q*D)*G;b[1]=(-c*H+d*F-k*D)*G;b[2]=(m*y-t*x+p*w)*G;b[3]=(-u*y+j*x-l*w)*G;b[4]=(-h*H+g*C-q*A)*G;b[5]=(e*H-d*C+k*A)*G;b[6]=(-r*y+t*v-p*n)*G;b[7]=(I*y-j*v+l*n)*G;b[8]=(h*F-f*C+q*z)*G;b[9]= -(-e*F+c*C-k*z)*G;b[10]=(r*x-m*v+p*s)*G;b[11]=(-I*x+u*v-l*s)*G;b[12]=(-h*D+f*A-g*z)*G;b[13]=(e*D-c*A+d*z)*G;b[14]=(-r*w+m*n-t*s)*G;b[15]=(I*w-u*n+j*s)*G;return b},toRotationMat:function(a,b){b||(b=y.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=F.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10]; -return b},toInverseMat3:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[4],h=a[5],f=a[6],g=a[8],q=a[9],j=a[10],u=j*h-f*q,l=-j*k+f*g,m=q*k-h*g,r=e*u+c*l+d*m;if(!r)return null;r=1/r;b||(b=F.create());b[0]=u*r;b[1]=(-j*c+d*q)*r;b[2]=(f*c-d*h)*r;b[3]=l*r;b[4]=(j*e-d*g)*r;b[5]=(-f*e+d*k)*r;b[6]=m*r;b[7]=(-q*e+c*g)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],f=a[4],g=a[5],q=a[6],j=a[7],u=a[8],l=a[9],m=a[10],r=a[11],p=a[12],t=a[13],s=a[14];a=a[15];var n=b[0], -B=b[1],v=b[2],w=b[3];e[0]=n*c+B*f+v*u+w*p;e[1]=n*d+B*g+v*l+w*t;e[2]=n*k+B*q+v*m+w*s;e[3]=n*h+B*j+v*r+w*a;n=b[4];B=b[5];v=b[6];w=b[7];e[4]=n*c+B*f+v*u+w*p;e[5]=n*d+B*g+v*l+w*t;e[6]=n*k+B*q+v*m+w*s;e[7]=n*h+B*j+v*r+w*a;n=b[8];B=b[9];v=b[10];w=b[11];e[8]=n*c+B*f+v*u+w*p;e[9]=n*d+B*g+v*l+w*t;e[10]=n*k+B*q+v*m+w*s;e[11]=n*h+B*j+v*r+w*a;n=b[12];B=b[13];v=b[14];w=b[15];e[12]=n*c+B*f+v*u+w*p;e[13]=n*d+B*g+v*l+w*t;e[14]=n*k+B*q+v*m+w*s;e[15]=n*h+B*j+v*r+w*a;return e},multiplyVec3:function(a,b,e){e||(e=b); -var c=b[0],d=b[1];b=b[2];e[0]=a[0]*c+a[4]*d+a[8]*b+a[12];e[1]=a[1]*c+a[5]*d+a[9]*b+a[13];e[2]=a[2]*c+a[6]*d+a[10]*b+a[14];return e},multiplyVec4:function(a,b,e){e||(e=b);var c=b[0],d=b[1],k=b[2];b=b[3];e[0]=a[0]*c+a[4]*d+a[8]*k+a[12]*b;e[1]=a[1]*c+a[5]*d+a[9]*k+a[13]*b;e[2]=a[2]*c+a[6]*d+a[10]*k+a[14]*b;e[3]=a[3]*c+a[7]*d+a[11]*k+a[15]*b;return e},translate:function(a,b,e){var c=b[0],d=b[1];b=b[2];var k,h,f,g,q,j,u,l,m,n,p,s;if(!e||a===e)return a[12]=a[0]*c+a[4]*d+a[8]*b+a[12],a[13]=a[1]*c+a[5]*d+ -a[9]*b+a[13],a[14]=a[2]*c+a[6]*d+a[10]*b+a[14],a[15]=a[3]*c+a[7]*d+a[11]*b+a[15],a;k=a[0];h=a[1];f=a[2];g=a[3];q=a[4];j=a[5];u=a[6];l=a[7];m=a[8];n=a[9];p=a[10];s=a[11];e[0]=k;e[1]=h;e[2]=f;e[3]=g;e[4]=q;e[5]=j;e[6]=u;e[7]=l;e[8]=m;e[9]=n;e[10]=p;e[11]=s;e[12]=k*c+q*d+m*b+a[12];e[13]=h*c+j*d+n*b+a[13];e[14]=f*c+u*d+p*b+a[14];e[15]=g*c+l*d+s*b+a[15];return e},scale:function(a,b,e){var c=b[0],d=b[1];b=b[2];if(!e||a===e)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=d,a[5]*=d,a[6]*=d,a[7]*=d,a[8]*=b,a[9]*= -b,a[10]*=b,a[11]*=b,a;e[0]=a[0]*c;e[1]=a[1]*c;e[2]=a[2]*c;e[3]=a[3]*c;e[4]=a[4]*d;e[5]=a[5]*d;e[6]=a[6]*d;e[7]=a[7]*d;e[8]=a[8]*b;e[9]=a[9]*b;e[10]=a[10]*b;e[11]=a[11]*b;e[12]=a[12];e[13]=a[13];e[14]=a[14];e[15]=a[15];return e},rotate:function(a,b,e,c){var d=e[0],k=e[1];e=e[2];var h=Math.sqrt(d*d+k*k+e*e),f,g,q,j,l,m,n,r,p,s,x,y,B,v,w,z,A,C,D,F;if(!h)return null;1!==h&&(h=1/h,d*=h,k*=h,e*=h);f=Math.sin(b);g=Math.cos(b);q=1-g;b=a[0];h=a[1];j=a[2];l=a[3];m=a[4];n=a[5];r=a[6];p=a[7];s=a[8];x=a[9];y= -a[10];B=a[11];v=d*d*q+g;w=k*d*q+e*f;z=e*d*q-k*f;A=d*k*q-e*f;C=k*k*q+g;D=e*k*q+d*f;F=d*e*q+k*f;d=k*e*q-d*f;k=e*e*q+g;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=b*v+m*w+s*z;c[1]=h*v+n*w+x*z;c[2]=j*v+r*w+y*z;c[3]=l*v+p*w+B*z;c[4]=b*A+m*C+s*D;c[5]=h*A+n*C+x*D;c[6]=j*A+r*C+y*D;c[7]=l*A+p*C+B*D;c[8]=b*F+m*d+s*k;c[9]=h*F+n*d+x*k;c[10]=j*F+r*d+y*k;c[11]=l*F+p*d+B*k;return c},rotateX:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[4],k=a[5],h=a[6],f=a[7],g=a[8],q=a[9],j=a[10], -l=a[11];e?a!==e&&(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[4]=d*b+g*c;e[5]=k*b+q*c;e[6]=h*b+j*c;e[7]=f*b+l*c;e[8]=d*-c+g*b;e[9]=k*-c+q*b;e[10]=h*-c+j*b;e[11]=f*-c+l*b;return e},rotateY:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[8],j=a[9],l=a[10],m=a[11];e?a!==e&&(e[4]=a[4],e[5]=a[5],e[6]=a[6],e[7]=a[7],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*-c;e[1]=k*b+j*-c;e[2]=h*b+l*-c;e[3]=f* -b+m*-c;e[8]=d*c+g*b;e[9]=k*c+j*b;e[10]=h*c+l*b;e[11]=f*c+m*b;return e},rotateZ:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[4],j=a[5],l=a[6],m=a[7];e?a!==e&&(e[8]=a[8],e[9]=a[9],e[10]=a[10],e[11]=a[11],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*c;e[1]=k*b+j*c;e[2]=h*b+l*c;e[3]=f*b+m*c;e[4]=d*-c+g*b;e[5]=k*-c+j*b;e[6]=h*-c+l*b;e[7]=f*-c+m*b;return e},frustum:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2*d/f;h[1]=0; -h[2]=0;h[3]=0;h[4]=0;h[5]=2*d/g;h[6]=0;h[7]=0;h[8]=(b+a)/f;h[9]=(c+e)/g;h[10]=-(k+d)/j;h[11]=-1;h[12]=0;h[13]=0;h[14]=-(2*k*d)/j;h[15]=0;return h},perspective:function(a,b,e,c,d){a=e*Math.tan(a*Math.PI/360);b*=a;return y.frustum(-b,b,-a,a,e,c,d)},ortho:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2/f;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/g;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/j;h[11]=0;h[12]=-(a+b)/f;h[13]=-(c+e)/g;h[14]=-(k+d)/j;h[15]=1;return h},lookAt:function(a,b,e,c){c|| -(c=y.create());var d,k,h,f,g,j,l,m,n=a[0],p=a[1];a=a[2];h=e[0];f=e[1];k=e[2];l=b[0];e=b[1];d=b[2];if(n===l&&p===e&&a===d)return y.identity(c);b=n-l;e=p-e;l=a-d;m=1/Math.sqrt(b*b+e*e+l*l);b*=m;e*=m;l*=m;d=f*l-k*e;k=k*b-h*l;h=h*e-f*b;(m=Math.sqrt(d*d+k*k+h*h))?(m=1/m,d*=m,k*=m,h*=m):h=k=d=0;f=e*h-l*k;g=l*d-b*h;j=b*k-e*d;(m=Math.sqrt(f*f+g*g+j*j))?(m=1/m,f*=m,g*=m,j*=m):j=g=f=0;c[0]=d;c[1]=f;c[2]=b;c[3]=0;c[4]=k;c[5]=g;c[6]=e;c[7]=0;c[8]=h;c[9]=j;c[10]=l;c[11]=0;c[12]=-(d*n+k*p+h*a);c[13]=-(f*n+g*p+ -j*a);c[14]=-(b*n+e*p+l*a);c[15]=1;return c},fromRotationTranslation:function(a,b,e){e||(e=y.create());var c=a[0],d=a[1],k=a[2],h=a[3],f=c+c,g=d+d,j=k+k;a=c*f;var l=c*g,c=c*j,m=d*g,d=d*j,k=k*j,f=h*f,g=h*g,h=h*j;e[0]=1-(m+k);e[1]=l+h;e[2]=c-g;e[3]=0;e[4]=l-h;e[5]=1-(a+k);e[6]=d+f;e[7]=0;e[8]=c+g;e[9]=d-f;e[10]=1-(a+m);e[11]=0;e[12]=b[0];e[13]=b[1];e[14]=b[2];e[15]=1;return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ -a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},s={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,e,c){var d=new l(4);d[0]=a;d[1]=b;d[2]=e;d[3]=c;return d},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=s.create()); -a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},O=s.identity();s.calculateW=function(a,b){var e=a[0],c=a[1],d=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d)),a;b[0]=e;b[1]=c;b[2]=d;b[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d));return b};s.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};s.inverse=function(a,b){var e=a[0],c=a[1],d=a[2],f=a[3],e=(e=e*e+c*c+d*d+f*f)?1/e:0;if(!b||a===b)return a[0]*=-e,a[1]*=-e,a[2]*=-e,a[3]*=e,a;b[0]=-a[0]*e;b[1]=-a[1]*e;b[2]=-a[2]*e;b[3]=a[3]*e; -return b};s.conjugate=function(a,b){if(!b||a===b)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};s.length=function(a){var b=a[0],e=a[1],c=a[2];a=a[3];return Math.sqrt(b*b+e*e+c*c+a*a)};s.normalize=function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],f=a[3],h=Math.sqrt(e*e+c*c+d*d+f*f);if(0===h)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;h=1/h;b[0]=e*h;b[1]=c*h;b[2]=d*h;b[3]=f*h;return b};s.add=function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+= -b[3],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];e[3]=a[3]+b[3];return e};s.multiply=function(a,b,e){e||(e=a);var c=a[0],d=a[1],f=a[2];a=a[3];var h=b[0],g=b[1],j=b[2];b=b[3];e[0]=c*b+a*h+d*j-f*g;e[1]=d*b+a*g+f*h-c*j;e[2]=f*b+a*j+c*g-d*h;e[3]=a*b-c*h-d*g-f*j;return e};s.multiplyVec3=function(a,b,e){e||(e=b);var c=b[0],d=b[1],f=b[2];b=a[0];var h=a[1],g=a[2];a=a[3];var j=a*c+h*f-g*d,l=a*d+g*c-b*f,m=a*f+b*d-h*c,c=-b*c-h*d-g*f;e[0]=j*a+c*-b+l*-g-m*-h;e[1]=l*a+c*-h+m*-b-j*-g;e[2]=m*a+c*-g+j*-h-l*-b; -return e};s.scale=function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a[3]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;e[3]=a[3]*b;return e};s.toMat3=function(a,b){b||(b=F.create());var e=a[0],c=a[1],d=a[2],f=a[3],h=e+e,g=c+c,j=d+d,l=e*h,m=e*g,e=e*j,n=c*g,c=c*j,d=d*j,h=f*h,g=f*g,f=f*j;b[0]=1-(n+d);b[1]=m+f;b[2]=e-g;b[3]=m-f;b[4]=1-(l+d);b[5]=c+h;b[6]=e+g;b[7]=c-h;b[8]=1-(l+n);return b};s.toMat4=function(a,b){b||(b=y.create());var e=a[0],c=a[1],d=a[2],f=a[3],g=e+e,j=c+c,l=d+d,m=e*g,n=e*j,e=e* -l,p=c*j,c=c*l,d=d*l,g=f*g,j=f*j,f=f*l;b[0]=1-(p+d);b[1]=n+f;b[2]=e-j;b[3]=0;b[4]=n-f;b[5]=1-(m+d);b[6]=c+g;b[7]=0;b[8]=e+j;b[9]=c-g;b[10]=1-(m+p);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};s.slerp=function(a,b,c,d){d||(d=a);var f=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],g,h;if(1<=Math.abs(f))return d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d;g=Math.acos(f);h=Math.sqrt(1-f*f);if(0.001>Math.abs(h))return d[0]=0.5*a[0]+0.5*b[0],d[1]=0.5*a[1]+0.5*b[1],d[2]=0.5*a[2]+0.5*b[2],d[3]=0.5*a[3]+ -0.5*b[3],d;f=Math.sin((1-c)*g)/h;c=Math.sin(c*g)/h;d[0]=a[0]*f+b[0]*c;d[1]=a[1]*f+b[1]*c;d[2]=a[2]*f+b[2]*c;d[3]=a[3]*f+b[3]*c;return d};s.fromRotationMatrix=function(a,b){b||(b=s.create());var c=a[0]+a[4]+a[8],d;if(0a[0]&&(c=1);a[8]>a[3*c+c]&&(c=2);var f=d[c],g=d[f];d=Math.sqrt(a[3*c+c]-a[3*f+f]-a[3*g+g]+1);b[c]=0.5*d;d= -0.5/d;b[3]=(a[3*g+f]-a[3*f+g])*d;b[f]=(a[3*f+c]+a[3*c+f])*d;b[g]=(a[3*g+c]+a[3*c+g])*d}return b};F.toQuat4=s.fromRotationMatrix;var D=F.create();s.fromAxes=function(a,b,c,d){D[0]=b[0];D[3]=b[1];D[6]=b[2];D[1]=c[0];D[4]=c[1];D[7]=c[2];D[2]=a[0];D[5]=a[1];D[8]=a[2];return s.fromRotationMatrix(D,d)};s.identity=function(a){a||(a=s.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};s.fromAngleAxis=function(a,b,c){c||(c=s.create());a*=0.5;var d=Math.sin(a);c[3]=Math.cos(a);c[0]=d*b[0];c[1]=d*b[1];c[2]=d*b[2]; -return c};s.toAngleAxis=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); -b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 -Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],f=a[2],g=a[3],h=c*g-f*d;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-d*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, -b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];c[0]=d*b[0]+f*b[2];c[1]=d*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=d*b+f*h;c[1]=d*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var d=b[0];b=b[1];c[0]=d*a[0]+b*a[1];c[1]=d*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var d=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=d*b;c[2]=f*h;c[3]= -g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,d){var f=new l(4);f[0]=a;f[1]=b;f[2]=c;f[3]=d;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, -b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| -(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)},squaredLength:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};c&&(c.glMatrixArrayType=l,c.MatrixArray=l,c.setMatrixArrayType=d,c.determineMatrixArrayType= -f,c.glMath=g,c.vec2=M,c.vec3=j,c.vec4=N,c.mat2=L,c.mat3=F,c.mat4=y,c.quat4=s);return{glMatrixArrayType:l,MatrixArray:l,setMatrixArrayType:d,determineMatrixArrayType:f,glMath:g,vec2:M,vec3:j,vec4:N,mat2:L,mat3:F,mat4:y,quat4:s}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * vColor;","}"]; -PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"]; -PIXI.CompileVertexShader=function(c,d){for(var f="",g=0;g>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/examples/bunny benchmark/index.html b/examples/bunny benchmark/index.html index 7c5521b..95972c4 100644 --- a/examples/bunny benchmark/index.html +++ b/examples/bunny benchmark/index.html @@ -9,9 +9,10 @@ +
    Click to add more bunnys! Let me know how many you get on screen here @doormat23
    - + diff --git a/examples/bunny benchmark/js/bunnyBenchMark.js b/examples/bunny benchmark/js/bunnyBenchMark.js index a3154eb..c3c8ec5 100644 --- a/examples/bunny benchmark/js/bunnyBenchMark.js +++ b/examples/bunny benchmark/js/bunnyBenchMark.js @@ -22,18 +22,13 @@ var count = 0; var container; +var detail; + function onReady() { - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() + detail = document.getElementById("pixi"); - if(webgl) - { - renderer = new PIXI.WebGLRenderer(); - } - else - { - renderer = new PIXI.CanvasRenderer(480, 320); - } + renderer = PIXI.autoDetectRenderer(); stage = new PIXI.Stage; @@ -46,7 +41,7 @@ stats.domElement.style.top = "0px"; requestAnimFrame(update); - wabbitTexture = new PIXI.Texture("wabbit.png") + wabbitTexture = new PIXI.Texture.fromImage("wabbit.png") counter = document.createElement("div"); counter.className = "counter"; @@ -55,7 +50,6 @@ count = startBunnyCount; counter.innerHTML = count + " BUNNIES"; - container = new PIXI.DisplayObjectContainer(); stage.addChild(container); @@ -114,7 +108,9 @@ minX = 0; maxY = height; minY = 0; - + + detail.style.left = width - 204 + "px"; + detail.style.top = height - 100 + "px"; renderer.resize(width, height); } @@ -126,17 +122,17 @@ { // add 10 at a time :) - for (var i = 0; i < 2; i++) + for (var i = 0; i < 10; i++) { - var bunny = new PIXI.Sprite(wabbitTexture, {x:0, y:0, width:26, height:37}); + var bunny = new PIXI.Sprite(wabbitTexture); bunny.speedX = Math.random() * 10; bunny.speedY = (Math.random() * 10) - 5; bunny.anchor.x = 0.5; bunny.anchor.y = 1; - bunny.alpha = 0.3 + Math.random() * 0.7; + //bunny.alpha = 0.3 + Math.random() * 0.7; bunnys.push(bunny); - bunny.rotation = Math.random() - 0.5; + //bunny.rotation = Math.random() - 0.5; container.addChild(bunny); count++; diff --git a/examples/bunny benchmark/js/pixi.js b/examples/bunny benchmark/js/pixi.js new file mode 100644 index 0000000..65add09 --- /dev/null +++ b/examples/bunny benchmark/js/pixi.js @@ -0,0 +1,110 @@ +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, +d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* +j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= +a[0]-d[0],c=a[1]-d[1];a=a[2]-d[2];d=Math.sqrt(b*b+c*c+a*a);if(!d)return j[0]=0,j[1]=0,j[2]=0,j;d=1/d;j[0]=b*d;j[1]=c*d;j[2]=a*d;return j},lerp:function(a,d,j,b){b||(b=a);b[0]=a[0]+j*(d[0]-a[0]);b[1]=a[1]+j*(d[1]-a[1]);b[2]=a[2]+j*(d[2]-a[2]);return b},dist:function(a,d){var j=d[0]-a[0],b=d[1]-a[1],c=d[2]-a[2];return Math.sqrt(j*j+b*b+c*c)}},p=null,q=new k(4);l.unproject=function(a,d,j,b,c){c||(c=a);p||(p=t.create());var e=p;q[0]=2*(a[0]-b[0])/b[2]-1;q[1]=2*(a[1]-b[1])/b[3]-1;q[2]=2*a[2]-1;q[3]=1; +t.multiply(j,d,e);if(!t.inverse(e))return null;t.multiplyVec4(e,q);if(0===q[3])return null;c[0]=q[0]/q[3];c[1]=q[1]/q[3];c[2]=q[2]/q[3];return c};var C=l.createFrom(1,0,0),F=l.createFrom(0,1,0),u=l.createFrom(0,0,1),w=l.create();l.rotationTo=function(a,d,j){j||(j=m.create());var b=l.dot(a,d);if(1<=b)m.set(H,j);else if(-0.999999>b)l.cross(C,a,w),1E-6>l.length(w)&&l.cross(F,a,w),1E-6>l.length(w)&&l.cross(u,a,w),l.normalize(w),m.fromAngleAxis(Math.PI,w,j);else{var b=Math.sqrt(2*(1+b)),c=1/b;l.cross(a, +d,w);j[0]=w[0]*c;j[1]=w[1]*c;j[2]=w[2]*c;j[3]=0.5*b;m.normalize(j)}1j[3]&&(j[3]=-1);return j};l.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var x={create:function(a){var d=new k(9);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8]):d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=0;return d},createFrom:function(a,d,j,b,c,e,n,f,E){var s=new k(9);s[0]=a;s[1]=d;s[2]=j;s[3]=b;s[4]=c;s[5]=e;s[6]=n;s[7]=f;s[8]=E;return s},determinant:function(a){var d= +a[3],j=a[4],b=a[5],c=a[6],e=a[7],n=a[8];return a[0]*(n*j-b*e)+a[1]*(-n*d+b*c)+a[2]*(e*d-j*c)},inverse:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[3],n=a[4],f=a[5],E=a[6],s=a[7],I=a[8],g=I*n-f*s,h=-I*e+f*E,k=s*e-n*E,r=j*g+b*h+c*k;if(!r)return null;r=1/r;d||(d=x.create());d[0]=g*r;d[1]=(-I*b+c*s)*r;d[2]=(f*b-c*n)*r;d[3]=h*r;d[4]=(I*j-c*E)*r;d[5]=(-f*j+c*e)*r;d[6]=k*r;d[7]=(-s*j+b*E)*r;d[8]=(n*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],D=a[4],E=a[5],s=a[6],I= +a[7];a=a[8];var g=d[0],h=d[1],k=d[2],r=d[3],m=d[4],l=d[5],q=d[6],v=d[7];d=d[8];j[0]=g*b+h*f+k*s;j[1]=g*c+h*D+k*I;j[2]=g*e+h*E+k*a;j[3]=r*b+m*f+l*s;j[4]=r*c+m*D+l*I;j[5]=r*e+m*E+l*a;j[6]=q*b+v*f+d*s;j[7]=q*c+v*D+d*I;j[8]=q*e+v*E+d*a;return j},multiplyVec2:function(a,d,j){j||(j=d);var b=d[0];d=d[1];j[0]=b*a[0]+d*a[3]+a[6];j[1]=b*a[1]+d*a[4]+a[7];return j},multiplyVec3:function(a,d,j){j||(j=d);var b=d[0],c=d[1];d=d[2];j[0]=b*a[0]+c*a[3]+d*a[6];j[1]=b*a[1]+c*a[4]+d*a[7];j[2]=b*a[2]+c*a[5]+d*a[8];return j}, +set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])},identity:function(a){a||(a=x.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, +d){if(!d||a===d){var j=a[1],b=a[2],c=a[5];a[1]=a[3];a[2]=a[6];a[3]=j;a[5]=a[7];a[6]=b;a[7]=c;return a}d[0]=a[0];d[1]=a[3];d[2]=a[6];d[3]=a[1];d[4]=a[4];d[5]=a[7];d[6]=a[2];d[7]=a[5];d[8]=a[8];return d},toMat4:function(a,d){d||(d=t.create());d[15]=1;d[14]=0;d[13]=0;d[12]=0;d[11]=0;d[10]=a[8];d[9]=a[7];d[8]=a[6];d[7]=0;d[6]=a[5];d[5]=a[4];d[4]=a[3];d[3]=0;d[2]=a[2];d[1]=a[1];d[0]=a[0];return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ +a[8]+"]"}},t={create:function(a){var d=new k(16);a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8],d[9]=a[9],d[10]=a[10],d[11]=a[11],d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d},createFrom:function(a,d,j,b,c,e,f,D,E,s,g,h,m,l,r,q){var A=new k(16);A[0]=a;A[1]=d;A[2]=j;A[3]=b;A[4]=c;A[5]=e;A[6]=f;A[7]=D;A[8]=E;A[9]=s;A[10]=g;A[11]=h;A[12]=m;A[13]=l;A[14]=r;A[15]=q;return A},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4]; +d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=a[12];d[13]=a[13];d[14]=a[14];d[15]=a[15];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])&&1E-6>Math.abs(a[9]-d[9])&&1E-6>Math.abs(a[10]-d[10])&&1E-6>Math.abs(a[11]-d[11])&&1E-6>Math.abs(a[12]- +d[12])&&1E-6>Math.abs(a[13]-d[13])&&1E-6>Math.abs(a[14]-d[14])&&1E-6>Math.abs(a[15]-d[15])},identity:function(a){a||(a=t.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,d){if(!d||a===d){var j=a[1],b=a[2],c=a[3],e=a[6],f=a[7],D=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=j;a[6]=a[9];a[7]=a[13];a[8]=b;a[9]=e;a[11]=a[14];a[12]=c;a[13]=f;a[14]=D;return a}d[0]=a[0];d[1]=a[4];d[2]=a[8];d[3]=a[12]; +d[4]=a[1];d[5]=a[5];d[6]=a[9];d[7]=a[13];d[8]=a[2];d[9]=a[6];d[10]=a[10];d[11]=a[14];d[12]=a[3];d[13]=a[7];d[14]=a[11];d[15]=a[15];return d},determinant:function(a){var d=a[0],j=a[1],b=a[2],c=a[3],e=a[4],f=a[5],D=a[6],E=a[7],s=a[8],g=a[9],h=a[10],k=a[11],m=a[12],r=a[13],l=a[14];a=a[15];return m*g*D*c-s*r*D*c-m*f*h*c+e*r*h*c+s*f*l*c-e*g*l*c-m*g*b*E+s*r*b*E+m*j*h*E-d*r*h*E-s*j*l*E+d*g*l*E+m*f*b*k-e*r*b*k-m*j*D*k+d*r*D*k+e*j*l*k-d*f*l*k-s*f*b*a+e*g*b*a+s*j*D*a-d*g*D*a-e*j*h*a+d*f*h*a},inverse:function(a, +d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=a[3],f=a[4],D=a[5],E=a[6],s=a[7],g=a[8],h=a[9],k=a[10],m=a[11],r=a[12],l=a[13],A=a[14],q=a[15],v=j*D-b*f,J=j*E-c*f,y=j*s-e*f,z=b*E-c*D,t=b*s-e*D,u=c*s-e*E,p=g*l-h*r,w=g*A-k*r,x=g*q-m*r,B=h*A-k*l,C=h*q-m*l,F=k*q-m*A,G=v*F-J*C+y*B+z*x-t*w+u*p;if(!G)return null;G=1/G;d[0]=(D*F-E*C+s*B)*G;d[1]=(-b*F+c*C-e*B)*G;d[2]=(l*u-A*t+q*z)*G;d[3]=(-h*u+k*t-m*z)*G;d[4]=(-f*F+E*x-s*w)*G;d[5]=(j*F-c*x+e*w)*G;d[6]=(-r*u+A*y-q*J)*G;d[7]=(g*u-k*y+m*J)*G;d[8]=(f*C-D*x+s*p)*G;d[9]= +(-j*C+b*x-e*p)*G;d[10]=(r*t-l*y+q*v)*G;d[11]=(-g*t+h*y-m*v)*G;d[12]=(-f*B+D*w-E*p)*G;d[13]=(j*B-b*w+c*p)*G;d[14]=(-r*z+l*J-A*v)*G;d[15]=(g*z-h*J+k*v)*G;return d},toRotationMat:function(a,d){d||(d=t.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d},toMat3:function(a,d){d||(d=x.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[4];d[4]=a[5];d[5]=a[6];d[6]=a[8];d[7]=a[9];d[8]=a[10]; +return d},toInverseMat3:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[4],f=a[5],D=a[6],g=a[8],s=a[9],h=a[10],k=h*f-D*s,m=-h*e+D*g,l=s*e-f*g,r=j*k+b*m+c*l;if(!r)return null;r=1/r;d||(d=x.create());d[0]=k*r;d[1]=(-h*b+c*s)*r;d[2]=(D*b-c*f)*r;d[3]=m*r;d[4]=(h*j-c*g)*r;d[5]=(-D*j+c*e)*r;d[6]=l*r;d[7]=(-s*j+b*g)*r;d[8]=(f*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],s=a[6],k=a[7],m=a[8],l=a[9],q=a[10],r=a[11],t=a[12],A=a[13],u=a[14];a=a[15];var v=d[0], +p=d[1],y=d[2],z=d[3];j[0]=v*b+p*g+y*m+z*t;j[1]=v*c+p*h+y*l+z*A;j[2]=v*e+p*s+y*q+z*u;j[3]=v*f+p*k+y*r+z*a;v=d[4];p=d[5];y=d[6];z=d[7];j[4]=v*b+p*g+y*m+z*t;j[5]=v*c+p*h+y*l+z*A;j[6]=v*e+p*s+y*q+z*u;j[7]=v*f+p*k+y*r+z*a;v=d[8];p=d[9];y=d[10];z=d[11];j[8]=v*b+p*g+y*m+z*t;j[9]=v*c+p*h+y*l+z*A;j[10]=v*e+p*s+y*q+z*u;j[11]=v*f+p*k+y*r+z*a;v=d[12];p=d[13];y=d[14];z=d[15];j[12]=v*b+p*g+y*m+z*t;j[13]=v*c+p*h+y*l+z*A;j[14]=v*e+p*s+y*q+z*u;j[15]=v*f+p*k+y*r+z*a;return j},multiplyVec3:function(a,d,b){b||(b=d); +var c=d[0],e=d[1];d=d[2];b[0]=a[0]*c+a[4]*e+a[8]*d+a[12];b[1]=a[1]*c+a[5]*e+a[9]*d+a[13];b[2]=a[2]*c+a[6]*e+a[10]*d+a[14];return b},multiplyVec4:function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=d[3];b[0]=a[0]*c+a[4]*e+a[8]*f+a[12]*d;b[1]=a[1]*c+a[5]*e+a[9]*f+a[13]*d;b[2]=a[2]*c+a[6]*e+a[10]*f+a[14]*d;b[3]=a[3]*c+a[7]*e+a[11]*f+a[15]*d;return b},translate:function(a,d,b){var c=d[0],e=d[1];d=d[2];var f,n,g,h,s,k,m,l,p,r,q,t;if(!b||a===b)return a[12]=a[0]*c+a[4]*e+a[8]*d+a[12],a[13]=a[1]*c+a[5]*e+ +a[9]*d+a[13],a[14]=a[2]*c+a[6]*e+a[10]*d+a[14],a[15]=a[3]*c+a[7]*e+a[11]*d+a[15],a;f=a[0];n=a[1];g=a[2];h=a[3];s=a[4];k=a[5];m=a[6];l=a[7];p=a[8];r=a[9];q=a[10];t=a[11];b[0]=f;b[1]=n;b[2]=g;b[3]=h;b[4]=s;b[5]=k;b[6]=m;b[7]=l;b[8]=p;b[9]=r;b[10]=q;b[11]=t;b[12]=f*c+s*e+p*d+a[12];b[13]=n*c+k*e+r*d+a[13];b[14]=g*c+m*e+q*d+a[14];b[15]=h*c+l*e+t*d+a[15];return b},scale:function(a,d,b){var c=d[0],e=d[1];d=d[2];if(!b||a===b)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=d,a[9]*= +d,a[10]*=d,a[11]*=d,a;b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[7]=a[7]*e;b[8]=a[8]*d;b[9]=a[9]*d;b[10]=a[10]*d;b[11]=a[11]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},rotate:function(a,d,b,c){var e=b[0],f=b[1];b=b[2];var n=Math.sqrt(e*e+f*f+b*b),g,h,k,m,l,p,q,r,t,u,w,v,x,y,z,B,C,F,H,K;if(!n)return null;1!==n&&(n=1/n,e*=n,f*=n,b*=n);g=Math.sin(d);h=Math.cos(d);k=1-h;d=a[0];n=a[1];m=a[2];l=a[3];p=a[4];q=a[5];r=a[6];t=a[7];u=a[8];w=a[9];v= +a[10];x=a[11];y=e*e*k+h;z=f*e*k+b*g;B=b*e*k-f*g;C=e*f*k-b*g;F=f*f*k+h;H=b*f*k+e*g;K=e*b*k+f*g;e=f*b*k-e*g;f=b*b*k+h;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=d*y+p*z+u*B;c[1]=n*y+q*z+w*B;c[2]=m*y+r*z+v*B;c[3]=l*y+t*z+x*B;c[4]=d*C+p*F+u*H;c[5]=n*C+q*F+w*H;c[6]=m*C+r*F+v*H;c[7]=l*C+t*F+x*H;c[8]=d*K+p*e+u*f;c[9]=n*K+q*e+w*f;c[10]=m*K+r*e+v*f;c[11]=l*K+t*e+x*f;return c},rotateX:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[4],f=a[5],n=a[6],g=a[7],h=a[8],k=a[9],m=a[10], +l=a[11];b?a!==b&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[4]=e*d+h*c;b[5]=f*d+k*c;b[6]=n*d+m*c;b[7]=g*d+l*c;b[8]=e*-c+h*d;b[9]=f*-c+k*d;b[10]=n*-c+m*d;b[11]=g*-c+l*d;return b},rotateY:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[8],k=a[9],m=a[10],l=a[11];b?a!==b&&(b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*-c;b[1]=f*d+k*-c;b[2]=n*d+m*-c;b[3]=g* +d+l*-c;b[8]=e*c+h*d;b[9]=f*c+k*d;b[10]=n*c+m*d;b[11]=g*c+l*d;return b},rotateZ:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[4],k=a[5],m=a[6],l=a[7];b?a!==b&&(b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*c;b[1]=f*d+k*c;b[2]=n*d+m*c;b[3]=g*d+l*c;b[4]=e*-c+h*d;b[5]=f*-c+k*d;b[6]=n*-c+m*d;b[7]=g*-c+l*d;return b},frustum:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2*e/g;n[1]=0; +n[2]=0;n[3]=0;n[4]=0;n[5]=2*e/h;n[6]=0;n[7]=0;n[8]=(d+a)/g;n[9]=(c+b)/h;n[10]=-(f+e)/k;n[11]=-1;n[12]=0;n[13]=0;n[14]=-(2*f*e)/k;n[15]=0;return n},perspective:function(a,d,b,c,e){a=b*Math.tan(a*Math.PI/360);d*=a;return t.frustum(-d,d,-a,a,b,c,e)},ortho:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2/g;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=2/h;n[6]=0;n[7]=0;n[8]=0;n[9]=0;n[10]=-2/k;n[11]=0;n[12]=-(a+d)/g;n[13]=-(c+b)/h;n[14]=-(f+e)/k;n[15]=1;return n},lookAt:function(a,d,b,c){c|| +(c=t.create());var e,f,n,g,h,k,m,l,p=a[0],q=a[1];a=a[2];n=b[0];g=b[1];f=b[2];m=d[0];b=d[1];e=d[2];if(p===m&&q===b&&a===e)return t.identity(c);d=p-m;b=q-b;m=a-e;l=1/Math.sqrt(d*d+b*b+m*m);d*=l;b*=l;m*=l;e=g*m-f*b;f=f*d-n*m;n=n*b-g*d;(l=Math.sqrt(e*e+f*f+n*n))?(l=1/l,e*=l,f*=l,n*=l):n=f=e=0;g=b*n-m*f;h=m*e-d*n;k=d*f-b*e;(l=Math.sqrt(g*g+h*h+k*k))?(l=1/l,g*=l,h*=l,k*=l):k=h=g=0;c[0]=e;c[1]=g;c[2]=d;c[3]=0;c[4]=f;c[5]=h;c[6]=b;c[7]=0;c[8]=n;c[9]=k;c[10]=m;c[11]=0;c[12]=-(e*p+f*q+n*a);c[13]=-(g*p+h*q+ +k*a);c[14]=-(d*p+b*q+m*a);c[15]=1;return c},fromRotationTranslation:function(a,d,b){b||(b=t.create());var c=a[0],e=a[1],f=a[2],n=a[3],g=c+c,h=e+e,k=f+f;a=c*g;var l=c*h,c=c*k,m=e*h,e=e*k,f=f*k,g=n*g,h=n*h,n=n*k;b[0]=1-(m+f);b[1]=l+n;b[2]=c-h;b[3]=0;b[4]=l-n;b[5]=1-(a+f);b[6]=e+g;b[7]=0;b[8]=c+h;b[9]=e-g;b[10]=1-(a+m);b[11]=0;b[12]=d[0];b[13]=d[1];b[14]=d[2];b[15]=1;return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ +a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},m={create:function(a){var d=new k(4);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]):d[0]=d[1]=d[2]=d[3]=0;return d},createFrom:function(a,d,b,c){var e=new k(4);e[0]=a;e[1]=d;e[2]=b;e[3]=c;return e},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])},identity:function(a){a||(a=m.create()); +a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},H=m.identity();m.calculateW=function(a,d){var b=a[0],c=a[1],e=a[2];if(!d||a===d)return a[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e)),a;d[0]=b;d[1]=c;d[2]=e;d[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e));return d};m.dot=function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3]};m.inverse=function(a,d){var b=a[0],c=a[1],e=a[2],f=a[3],b=(b=b*b+c*c+e*e+f*f)?1/b:0;if(!d||a===d)return a[0]*=-b,a[1]*=-b,a[2]*=-b,a[3]*=b,a;d[0]=-a[0]*b;d[1]=-a[1]*b;d[2]=-a[2]*b;d[3]=a[3]*b; +return d};m.conjugate=function(a,d){if(!d||a===d)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=a[3];return d};m.length=function(a){var d=a[0],b=a[1],c=a[2];a=a[3];return Math.sqrt(d*d+b*b+c*c+a*a)};m.normalize=function(a,d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=Math.sqrt(b*b+c*c+e*e+f*f);if(0===g)return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d;g=1/g;d[0]=b*g;d[1]=c*g;d[2]=e*g;d[3]=f*g;return d};m.add=function(a,d,b){if(!b||a===b)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a[3]+= +d[3],a;b[0]=a[0]+d[0];b[1]=a[1]+d[1];b[2]=a[2]+d[2];b[3]=a[3]+d[3];return b};m.multiply=function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2];a=a[3];var g=d[0],h=d[1],k=d[2];d=d[3];b[0]=c*d+a*g+e*k-f*h;b[1]=e*d+a*h+f*g-c*k;b[2]=f*d+a*k+c*h-e*g;b[3]=a*d-c*g-e*h-f*k;return b};m.multiplyVec3=function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=a[0];var g=a[1],h=a[2];a=a[3];var k=a*c+g*f-h*e,l=a*e+h*c-d*f,m=a*f+d*e-g*c,c=-d*c-g*e-h*f;b[0]=k*a+c*-d+l*-h-m*-g;b[1]=l*a+c*-g+m*-d-k*-h;b[2]=m*a+c*-h+k*-g-l*-d; +return b};m.scale=function(a,d,b){if(!b||a===b)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a;b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[3]=a[3]*d;return b};m.toMat3=function(a,d){d||(d=x.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b*k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=m-f;d[4]=1-(l+e);d[5]=c+g;d[6]=b+h;d[7]=c-g;d[8]=1-(l+p);return d};m.toMat4=function(a,d){d||(d=t.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b* +k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=0;d[4]=m-f;d[5]=1-(l+e);d[6]=c+g;d[7]=0;d[8]=b+h;d[9]=c-g;d[10]=1-(l+p);d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d};m.slerp=function(a,d,b,c){c||(c=a);var e=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3],f,g;if(1<=Math.abs(e))return c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]),c;f=Math.acos(e);g=Math.sqrt(1-e*e);if(0.0010>Math.abs(g))return c[0]=0.5*a[0]+0.5*d[0],c[1]=0.5*a[1]+0.5*d[1],c[2]=0.5*a[2]+0.5*d[2],c[3]=0.5*a[3]+ +0.5*d[3],c;e=Math.sin((1-b)*f)/g;b=Math.sin(b*f)/g;c[0]=a[0]*e+d[0]*b;c[1]=a[1]*e+d[1]*b;c[2]=a[2]*e+d[2]*b;c[3]=a[3]*e+d[3]*b;return c};m.fromRotationMatrix=function(a,d){d||(d=m.create());var b=a[0]+a[4]+a[8],c;if(0a[0]&&(b=1);a[8]>a[3*b+b]&&(b=2);var e=c[b],f=c[e];c=Math.sqrt(a[3*b+b]-a[3*e+e]-a[3*f+f]+1);d[b]=0.5*c;c= +0.5/c;d[3]=(a[3*f+e]-a[3*e+f])*c;d[e]=(a[3*e+b]+a[3*b+e])*c;d[f]=(a[3*f+b]+a[3*b+f])*c}return d};x.toQuat4=m.fromRotationMatrix;var B=x.create();m.fromAxes=function(a,d,b,c){B[0]=d[0];B[3]=d[1];B[6]=d[2];B[1]=b[0];B[4]=b[1];B[7]=b[2];B[2]=a[0];B[5]=a[1];B[8]=a[2];return m.fromRotationMatrix(B,c)};m.identity=function(a){a||(a=m.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};m.fromAngleAxis=function(a,d,b){b||(b=m.create());a*=0.5;var c=Math.sin(a);b[3]=Math.cos(a);b[0]=c*d[0];b[1]=c*d[1];b[2]=c*d[2]; +return b};m.toAngleAxis=function(a,d){d||(d=a);var b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); +b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 +Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],e=a[1],f=a[2],g=a[3],h=c*g-f*e;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-e*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, +b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];c[0]=e*b[0]+f*b[2];c[1]=e*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=e*b+f*h;c[1]=e*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var e=b[0];b=b[1];c[0]=e*a[0]+b*a[1];c[1]=e*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var e=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=e*b;c[2]=f*h;c[3]= +g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, +b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| +(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= +f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; +PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; +PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l>1);var b=m[0];return b*(1.5-0.5*a*b*b)}}else g.invsqrt=function(a){return 1/Math.sqrt(a)}; -var l=null;f();var j={create:function(a){var b=new l(3);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0;return b},createFrom:function(a,b,e){var c=new l(3);c[0]=a;c[1]=b;c[2]=e;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])},add:function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];return e},subtract:function(a, -b,e){if(!e||a===e)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];return e},multiply:function(a,b,e){if(!e||a===e)return a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a;e[0]=a[0]*b[0];e[1]=a[1]*b[1];e[2]=a[2]*b[2];return e},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;return e},normalize:function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=Math.sqrt(e* -e+c*c+d*d);if(!k)return b[0]=0,b[1]=0,b[2]=0,b;if(1===k)return b[0]=e,b[1]=c,b[2]=d,b;k=1/k;b[0]=e*k;b[1]=c*k;b[2]=d*k;return b},cross:function(a,b,e){e||(e=a);var c=a[0],d=a[1];a=a[2];var k=b[0],h=b[1];b=b[2];e[0]=d*b-a*h;e[1]=a*k-c*b;e[2]=c*h-d*k;return e},length:function(a){var b=a[0],e=a[1];a=a[2];return Math.sqrt(b*b+e*e+a*a)},squaredLength:function(a){var b=a[0],e=a[1];a=a[2];return b*b+e*e+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,b,e){e||(e=a);var c= -a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];b=Math.sqrt(c*c+d*d+a*a);if(!b)return e[0]=0,e[1]=0,e[2]=0,e;b=1/b;e[0]=c*b;e[1]=d*b;e[2]=a*b;return e},lerp:function(a,b,e,c){c||(c=a);c[0]=a[0]+e*(b[0]-a[0]);c[1]=a[1]+e*(b[1]-a[1]);c[2]=a[2]+e*(b[2]-a[2]);return c},dist:function(a,b){var e=b[0]-a[0],c=b[1]-a[1],d=b[2]-a[2];return Math.sqrt(e*e+c*c+d*d)}},x=null,n=new l(4);j.unproject=function(a,b,e,c,d){d||(d=a);x||(x=y.create());var k=x;n[0]=2*(a[0]-c[0])/c[2]-1;n[1]=2*(a[1]-c[1])/c[3]-1;n[2]=2*a[2]-1;n[3]=1; -y.multiply(e,b,k);if(!y.inverse(k))return null;y.multiplyVec4(k,n);if(0===n[3])return null;d[0]=n[0]/n[3];d[1]=n[1]/n[3];d[2]=n[2]/n[3];return d};var z=j.createFrom(1,0,0),A=j.createFrom(0,1,0),H=j.createFrom(0,0,1),C=j.create();j.rotationTo=function(a,b,e){e||(e=s.create());var c=j.dot(a,b);if(1<=c)s.set(O,e);else if(-0.999999>c)j.cross(z,a,C),1E-6>j.length(C)&&j.cross(A,a,C),1E-6>j.length(C)&&j.cross(H,a,C),j.normalize(C),s.fromAngleAxis(Math.PI,C,e);else{var c=Math.sqrt(2*(1+c)),d=1/c;j.cross(a, -b,C);e[0]=C[0]*d;e[1]=C[1]*d;e[2]=C[2]*d;e[3]=0.5*c;s.normalize(e)}1e[3]&&(e[3]=-1);return e};j.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var F={create:function(a){var b=new l(9);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0;return b},createFrom:function(a,b,e,c,d,k,h,E,K){var q=new l(9);q[0]=a;q[1]=b;q[2]=e;q[3]=c;q[4]=d;q[5]=k;q[6]=h;q[7]=E;q[8]=K;return q},determinant:function(a){var b= -a[3],e=a[4],c=a[5],d=a[6],k=a[7],h=a[8];return a[0]*(h*e-c*k)+a[1]*(-h*b+c*d)+a[2]*(k*b-e*d)},inverse:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],E=a[5],K=a[6],q=a[7],f=a[8],g=f*h-E*q,j=-f*k+E*K,J=q*k-h*K,r=e*g+c*j+d*J;if(!r)return null;r=1/r;b||(b=F.create());b[0]=g*r;b[1]=(-f*c+d*q)*r;b[2]=(E*c-d*h)*r;b[3]=j*r;b[4]=(f*e-d*K)*r;b[5]=(-E*e+d*k)*r;b[6]=J*r;b[7]=(-q*e+c*K)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],E=a[4],f=a[5],q=a[6],g= -a[7];a=a[8];var u=b[0],j=b[1],J=b[2],r=b[3],l=b[4],t=b[5],m=b[6],p=b[7];b=b[8];e[0]=u*c+j*h+J*q;e[1]=u*d+j*E+J*g;e[2]=u*k+j*f+J*a;e[3]=r*c+l*h+t*q;e[4]=r*d+l*E+t*g;e[5]=r*k+l*f+t*a;e[6]=m*c+p*h+b*q;e[7]=m*d+p*E+b*g;e[8]=m*k+p*f+b*a;return e},multiplyVec2:function(a,b,e){e||(e=b);var c=b[0];b=b[1];e[0]=c*a[0]+b*a[3]+a[6];e[1]=c*a[1]+b*a[4]+a[7];return e},multiplyVec3:function(a,b,e){e||(e=b);var c=b[0],d=b[1];b=b[2];e[0]=c*a[0]+d*a[3]+b*a[6];e[1]=c*a[1]+d*a[4]+b*a[7];e[2]=c*a[2]+d*a[5]+b*a[8];return e}, -set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])},identity:function(a){a||(a=F.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, -b){if(!b||a===b){var e=a[1],c=a[2],d=a[5];a[1]=a[3];a[2]=a[6];a[3]=e;a[5]=a[7];a[6]=c;a[7]=d;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]=a[8];return b},toMat4:function(a,b){b||(b=y.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ -a[8]+"]"}},y={create:function(a){var b=new l(16);a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]);return b},createFrom:function(a,b,e,c,d,k,h,E,f,q,g,u,j,J,r,m){var t=new l(16);t[0]=a;t[1]=b;t[2]=e;t[3]=c;t[4]=d;t[5]=k;t[6]=h;t[7]=E;t[8]=f;t[9]=q;t[10]=g;t[11]=u;t[12]=j;t[13]=J;t[14]=r;t[15]=m;return t},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4]; -b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])&&1E-6>Math.abs(a[9]-b[9])&&1E-6>Math.abs(a[10]-b[10])&&1E-6>Math.abs(a[11]-b[11])&&1E-6>Math.abs(a[12]- -b[12])&&1E-6>Math.abs(a[13]-b[13])&&1E-6>Math.abs(a[14]-b[14])&&1E-6>Math.abs(a[15]-b[15])},identity:function(a){a||(a=y.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){var e=a[1],c=a[2],d=a[3],k=a[6],h=a[7],E=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=e;a[6]=a[9];a[7]=a[13];a[8]=c;a[9]=k;a[11]=a[14];a[12]=d;a[13]=h;a[14]=E;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12]; -b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b=a[0],e=a[1],c=a[2],d=a[3],k=a[4],h=a[5],E=a[6],f=a[7],g=a[8],I=a[9],u=a[10],j=a[11],l=a[12],r=a[13],m=a[14];a=a[15];return l*I*E*d-g*r*E*d-l*h*u*d+k*r*u*d+g*h*m*d-k*I*m*d-l*I*c*f+g*r*c*f+l*e*u*f-b*r*u*f-g*e*m*f+b*I*m*f+l*h*c*j-k*r*c*j-l*e*E*j+b*r*E*j+k*e*m*j-b*h*m*j-g*h*c*a+k*I*c*a+g*e*E*a-b*I*E*a-k*e*u*a+b*h*u*a},inverse:function(a, -b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],f=a[5],g=a[6],q=a[7],I=a[8],u=a[9],j=a[10],l=a[11],r=a[12],m=a[13],t=a[14],p=a[15],s=e*f-c*h,n=e*g-d*h,v=e*q-k*h,w=c*g-d*f,x=c*q-k*f,y=d*q-k*g,z=I*m-u*r,A=I*t-j*r,C=I*p-l*r,D=u*t-j*m,F=u*p-l*m,H=j*p-l*t,G=s*H-n*F+v*D+w*C-x*A+y*z;if(!G)return null;G=1/G;b[0]=(f*H-g*F+q*D)*G;b[1]=(-c*H+d*F-k*D)*G;b[2]=(m*y-t*x+p*w)*G;b[3]=(-u*y+j*x-l*w)*G;b[4]=(-h*H+g*C-q*A)*G;b[5]=(e*H-d*C+k*A)*G;b[6]=(-r*y+t*v-p*n)*G;b[7]=(I*y-j*v+l*n)*G;b[8]=(h*F-f*C+q*z)*G;b[9]= -(-e*F+c*C-k*z)*G;b[10]=(r*x-m*v+p*s)*G;b[11]=(-I*x+u*v-l*s)*G;b[12]=(-h*D+f*A-g*z)*G;b[13]=(e*D-c*A+d*z)*G;b[14]=(-r*w+m*n-t*s)*G;b[15]=(I*w-u*n+j*s)*G;return b},toRotationMat:function(a,b){b||(b=y.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=F.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10]; -return b},toInverseMat3:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[4],h=a[5],f=a[6],g=a[8],q=a[9],j=a[10],u=j*h-f*q,l=-j*k+f*g,m=q*k-h*g,r=e*u+c*l+d*m;if(!r)return null;r=1/r;b||(b=F.create());b[0]=u*r;b[1]=(-j*c+d*q)*r;b[2]=(f*c-d*h)*r;b[3]=l*r;b[4]=(j*e-d*g)*r;b[5]=(-f*e+d*k)*r;b[6]=m*r;b[7]=(-q*e+c*g)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],f=a[4],g=a[5],q=a[6],j=a[7],u=a[8],l=a[9],m=a[10],r=a[11],p=a[12],t=a[13],s=a[14];a=a[15];var n=b[0], -B=b[1],v=b[2],w=b[3];e[0]=n*c+B*f+v*u+w*p;e[1]=n*d+B*g+v*l+w*t;e[2]=n*k+B*q+v*m+w*s;e[3]=n*h+B*j+v*r+w*a;n=b[4];B=b[5];v=b[6];w=b[7];e[4]=n*c+B*f+v*u+w*p;e[5]=n*d+B*g+v*l+w*t;e[6]=n*k+B*q+v*m+w*s;e[7]=n*h+B*j+v*r+w*a;n=b[8];B=b[9];v=b[10];w=b[11];e[8]=n*c+B*f+v*u+w*p;e[9]=n*d+B*g+v*l+w*t;e[10]=n*k+B*q+v*m+w*s;e[11]=n*h+B*j+v*r+w*a;n=b[12];B=b[13];v=b[14];w=b[15];e[12]=n*c+B*f+v*u+w*p;e[13]=n*d+B*g+v*l+w*t;e[14]=n*k+B*q+v*m+w*s;e[15]=n*h+B*j+v*r+w*a;return e},multiplyVec3:function(a,b,e){e||(e=b); -var c=b[0],d=b[1];b=b[2];e[0]=a[0]*c+a[4]*d+a[8]*b+a[12];e[1]=a[1]*c+a[5]*d+a[9]*b+a[13];e[2]=a[2]*c+a[6]*d+a[10]*b+a[14];return e},multiplyVec4:function(a,b,e){e||(e=b);var c=b[0],d=b[1],k=b[2];b=b[3];e[0]=a[0]*c+a[4]*d+a[8]*k+a[12]*b;e[1]=a[1]*c+a[5]*d+a[9]*k+a[13]*b;e[2]=a[2]*c+a[6]*d+a[10]*k+a[14]*b;e[3]=a[3]*c+a[7]*d+a[11]*k+a[15]*b;return e},translate:function(a,b,e){var c=b[0],d=b[1];b=b[2];var k,h,f,g,q,j,u,l,m,n,p,s;if(!e||a===e)return a[12]=a[0]*c+a[4]*d+a[8]*b+a[12],a[13]=a[1]*c+a[5]*d+ -a[9]*b+a[13],a[14]=a[2]*c+a[6]*d+a[10]*b+a[14],a[15]=a[3]*c+a[7]*d+a[11]*b+a[15],a;k=a[0];h=a[1];f=a[2];g=a[3];q=a[4];j=a[5];u=a[6];l=a[7];m=a[8];n=a[9];p=a[10];s=a[11];e[0]=k;e[1]=h;e[2]=f;e[3]=g;e[4]=q;e[5]=j;e[6]=u;e[7]=l;e[8]=m;e[9]=n;e[10]=p;e[11]=s;e[12]=k*c+q*d+m*b+a[12];e[13]=h*c+j*d+n*b+a[13];e[14]=f*c+u*d+p*b+a[14];e[15]=g*c+l*d+s*b+a[15];return e},scale:function(a,b,e){var c=b[0],d=b[1];b=b[2];if(!e||a===e)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=d,a[5]*=d,a[6]*=d,a[7]*=d,a[8]*=b,a[9]*= -b,a[10]*=b,a[11]*=b,a;e[0]=a[0]*c;e[1]=a[1]*c;e[2]=a[2]*c;e[3]=a[3]*c;e[4]=a[4]*d;e[5]=a[5]*d;e[6]=a[6]*d;e[7]=a[7]*d;e[8]=a[8]*b;e[9]=a[9]*b;e[10]=a[10]*b;e[11]=a[11]*b;e[12]=a[12];e[13]=a[13];e[14]=a[14];e[15]=a[15];return e},rotate:function(a,b,e,c){var d=e[0],k=e[1];e=e[2];var h=Math.sqrt(d*d+k*k+e*e),f,g,q,j,l,m,n,r,p,s,x,y,B,v,w,z,A,C,D,F;if(!h)return null;1!==h&&(h=1/h,d*=h,k*=h,e*=h);f=Math.sin(b);g=Math.cos(b);q=1-g;b=a[0];h=a[1];j=a[2];l=a[3];m=a[4];n=a[5];r=a[6];p=a[7];s=a[8];x=a[9];y= -a[10];B=a[11];v=d*d*q+g;w=k*d*q+e*f;z=e*d*q-k*f;A=d*k*q-e*f;C=k*k*q+g;D=e*k*q+d*f;F=d*e*q+k*f;d=k*e*q-d*f;k=e*e*q+g;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=b*v+m*w+s*z;c[1]=h*v+n*w+x*z;c[2]=j*v+r*w+y*z;c[3]=l*v+p*w+B*z;c[4]=b*A+m*C+s*D;c[5]=h*A+n*C+x*D;c[6]=j*A+r*C+y*D;c[7]=l*A+p*C+B*D;c[8]=b*F+m*d+s*k;c[9]=h*F+n*d+x*k;c[10]=j*F+r*d+y*k;c[11]=l*F+p*d+B*k;return c},rotateX:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[4],k=a[5],h=a[6],f=a[7],g=a[8],q=a[9],j=a[10], -l=a[11];e?a!==e&&(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[4]=d*b+g*c;e[5]=k*b+q*c;e[6]=h*b+j*c;e[7]=f*b+l*c;e[8]=d*-c+g*b;e[9]=k*-c+q*b;e[10]=h*-c+j*b;e[11]=f*-c+l*b;return e},rotateY:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[8],j=a[9],l=a[10],m=a[11];e?a!==e&&(e[4]=a[4],e[5]=a[5],e[6]=a[6],e[7]=a[7],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*-c;e[1]=k*b+j*-c;e[2]=h*b+l*-c;e[3]=f* -b+m*-c;e[8]=d*c+g*b;e[9]=k*c+j*b;e[10]=h*c+l*b;e[11]=f*c+m*b;return e},rotateZ:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[4],j=a[5],l=a[6],m=a[7];e?a!==e&&(e[8]=a[8],e[9]=a[9],e[10]=a[10],e[11]=a[11],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*c;e[1]=k*b+j*c;e[2]=h*b+l*c;e[3]=f*b+m*c;e[4]=d*-c+g*b;e[5]=k*-c+j*b;e[6]=h*-c+l*b;e[7]=f*-c+m*b;return e},frustum:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2*d/f;h[1]=0; -h[2]=0;h[3]=0;h[4]=0;h[5]=2*d/g;h[6]=0;h[7]=0;h[8]=(b+a)/f;h[9]=(c+e)/g;h[10]=-(k+d)/j;h[11]=-1;h[12]=0;h[13]=0;h[14]=-(2*k*d)/j;h[15]=0;return h},perspective:function(a,b,e,c,d){a=e*Math.tan(a*Math.PI/360);b*=a;return y.frustum(-b,b,-a,a,e,c,d)},ortho:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2/f;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/g;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/j;h[11]=0;h[12]=-(a+b)/f;h[13]=-(c+e)/g;h[14]=-(k+d)/j;h[15]=1;return h},lookAt:function(a,b,e,c){c|| -(c=y.create());var d,k,h,f,g,j,l,m,n=a[0],p=a[1];a=a[2];h=e[0];f=e[1];k=e[2];l=b[0];e=b[1];d=b[2];if(n===l&&p===e&&a===d)return y.identity(c);b=n-l;e=p-e;l=a-d;m=1/Math.sqrt(b*b+e*e+l*l);b*=m;e*=m;l*=m;d=f*l-k*e;k=k*b-h*l;h=h*e-f*b;(m=Math.sqrt(d*d+k*k+h*h))?(m=1/m,d*=m,k*=m,h*=m):h=k=d=0;f=e*h-l*k;g=l*d-b*h;j=b*k-e*d;(m=Math.sqrt(f*f+g*g+j*j))?(m=1/m,f*=m,g*=m,j*=m):j=g=f=0;c[0]=d;c[1]=f;c[2]=b;c[3]=0;c[4]=k;c[5]=g;c[6]=e;c[7]=0;c[8]=h;c[9]=j;c[10]=l;c[11]=0;c[12]=-(d*n+k*p+h*a);c[13]=-(f*n+g*p+ -j*a);c[14]=-(b*n+e*p+l*a);c[15]=1;return c},fromRotationTranslation:function(a,b,e){e||(e=y.create());var c=a[0],d=a[1],k=a[2],h=a[3],f=c+c,g=d+d,j=k+k;a=c*f;var l=c*g,c=c*j,m=d*g,d=d*j,k=k*j,f=h*f,g=h*g,h=h*j;e[0]=1-(m+k);e[1]=l+h;e[2]=c-g;e[3]=0;e[4]=l-h;e[5]=1-(a+k);e[6]=d+f;e[7]=0;e[8]=c+g;e[9]=d-f;e[10]=1-(a+m);e[11]=0;e[12]=b[0];e[13]=b[1];e[14]=b[2];e[15]=1;return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ -a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},s={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,e,c){var d=new l(4);d[0]=a;d[1]=b;d[2]=e;d[3]=c;return d},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=s.create()); -a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},O=s.identity();s.calculateW=function(a,b){var e=a[0],c=a[1],d=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d)),a;b[0]=e;b[1]=c;b[2]=d;b[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d));return b};s.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};s.inverse=function(a,b){var e=a[0],c=a[1],d=a[2],f=a[3],e=(e=e*e+c*c+d*d+f*f)?1/e:0;if(!b||a===b)return a[0]*=-e,a[1]*=-e,a[2]*=-e,a[3]*=e,a;b[0]=-a[0]*e;b[1]=-a[1]*e;b[2]=-a[2]*e;b[3]=a[3]*e; -return b};s.conjugate=function(a,b){if(!b||a===b)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};s.length=function(a){var b=a[0],e=a[1],c=a[2];a=a[3];return Math.sqrt(b*b+e*e+c*c+a*a)};s.normalize=function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],f=a[3],h=Math.sqrt(e*e+c*c+d*d+f*f);if(0===h)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;h=1/h;b[0]=e*h;b[1]=c*h;b[2]=d*h;b[3]=f*h;return b};s.add=function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+= -b[3],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];e[3]=a[3]+b[3];return e};s.multiply=function(a,b,e){e||(e=a);var c=a[0],d=a[1],f=a[2];a=a[3];var h=b[0],g=b[1],j=b[2];b=b[3];e[0]=c*b+a*h+d*j-f*g;e[1]=d*b+a*g+f*h-c*j;e[2]=f*b+a*j+c*g-d*h;e[3]=a*b-c*h-d*g-f*j;return e};s.multiplyVec3=function(a,b,e){e||(e=b);var c=b[0],d=b[1],f=b[2];b=a[0];var h=a[1],g=a[2];a=a[3];var j=a*c+h*f-g*d,l=a*d+g*c-b*f,m=a*f+b*d-h*c,c=-b*c-h*d-g*f;e[0]=j*a+c*-b+l*-g-m*-h;e[1]=l*a+c*-h+m*-b-j*-g;e[2]=m*a+c*-g+j*-h-l*-b; -return e};s.scale=function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a[3]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;e[3]=a[3]*b;return e};s.toMat3=function(a,b){b||(b=F.create());var e=a[0],c=a[1],d=a[2],f=a[3],h=e+e,g=c+c,j=d+d,l=e*h,m=e*g,e=e*j,n=c*g,c=c*j,d=d*j,h=f*h,g=f*g,f=f*j;b[0]=1-(n+d);b[1]=m+f;b[2]=e-g;b[3]=m-f;b[4]=1-(l+d);b[5]=c+h;b[6]=e+g;b[7]=c-h;b[8]=1-(l+n);return b};s.toMat4=function(a,b){b||(b=y.create());var e=a[0],c=a[1],d=a[2],f=a[3],g=e+e,j=c+c,l=d+d,m=e*g,n=e*j,e=e* -l,p=c*j,c=c*l,d=d*l,g=f*g,j=f*j,f=f*l;b[0]=1-(p+d);b[1]=n+f;b[2]=e-j;b[3]=0;b[4]=n-f;b[5]=1-(m+d);b[6]=c+g;b[7]=0;b[8]=e+j;b[9]=c-g;b[10]=1-(m+p);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};s.slerp=function(a,b,c,d){d||(d=a);var f=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],g,h;if(1<=Math.abs(f))return d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d;g=Math.acos(f);h=Math.sqrt(1-f*f);if(0.001>Math.abs(h))return d[0]=0.5*a[0]+0.5*b[0],d[1]=0.5*a[1]+0.5*b[1],d[2]=0.5*a[2]+0.5*b[2],d[3]=0.5*a[3]+ -0.5*b[3],d;f=Math.sin((1-c)*g)/h;c=Math.sin(c*g)/h;d[0]=a[0]*f+b[0]*c;d[1]=a[1]*f+b[1]*c;d[2]=a[2]*f+b[2]*c;d[3]=a[3]*f+b[3]*c;return d};s.fromRotationMatrix=function(a,b){b||(b=s.create());var c=a[0]+a[4]+a[8],d;if(0a[0]&&(c=1);a[8]>a[3*c+c]&&(c=2);var f=d[c],g=d[f];d=Math.sqrt(a[3*c+c]-a[3*f+f]-a[3*g+g]+1);b[c]=0.5*d;d= -0.5/d;b[3]=(a[3*g+f]-a[3*f+g])*d;b[f]=(a[3*f+c]+a[3*c+f])*d;b[g]=(a[3*g+c]+a[3*c+g])*d}return b};F.toQuat4=s.fromRotationMatrix;var D=F.create();s.fromAxes=function(a,b,c,d){D[0]=b[0];D[3]=b[1];D[6]=b[2];D[1]=c[0];D[4]=c[1];D[7]=c[2];D[2]=a[0];D[5]=a[1];D[8]=a[2];return s.fromRotationMatrix(D,d)};s.identity=function(a){a||(a=s.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};s.fromAngleAxis=function(a,b,c){c||(c=s.create());a*=0.5;var d=Math.sin(a);c[3]=Math.cos(a);c[0]=d*b[0];c[1]=d*b[1];c[2]=d*b[2]; -return c};s.toAngleAxis=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); -b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 -Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],f=a[2],g=a[3],h=c*g-f*d;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-d*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, -b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];c[0]=d*b[0]+f*b[2];c[1]=d*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=d*b+f*h;c[1]=d*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var d=b[0];b=b[1];c[0]=d*a[0]+b*a[1];c[1]=d*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var d=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=d*b;c[2]=f*h;c[3]= -g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,d){var f=new l(4);f[0]=a;f[1]=b;f[2]=c;f[3]=d;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, -b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| -(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)},squaredLength:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};c&&(c.glMatrixArrayType=l,c.MatrixArray=l,c.setMatrixArrayType=d,c.determineMatrixArrayType= -f,c.glMath=g,c.vec2=M,c.vec3=j,c.vec4=N,c.mat2=L,c.mat3=F,c.mat4=y,c.quat4=s);return{glMatrixArrayType:l,MatrixArray:l,setMatrixArrayType:d,determineMatrixArrayType:f,glMath:g,vec2:M,vec3:j,vec4:N,mat2:L,mat3:F,mat4:y,quat4:s}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * vColor;","}"]; -PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"]; -PIXI.CompileVertexShader=function(c,d){for(var f="",g=0;g>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/examples/bunny benchmark/index.html b/examples/bunny benchmark/index.html index 7c5521b..95972c4 100644 --- a/examples/bunny benchmark/index.html +++ b/examples/bunny benchmark/index.html @@ -9,9 +9,10 @@ +
    Click to add more bunnys! Let me know how many you get on screen here @doormat23
    - + diff --git a/examples/bunny benchmark/js/bunnyBenchMark.js b/examples/bunny benchmark/js/bunnyBenchMark.js index a3154eb..c3c8ec5 100644 --- a/examples/bunny benchmark/js/bunnyBenchMark.js +++ b/examples/bunny benchmark/js/bunnyBenchMark.js @@ -22,18 +22,13 @@ var count = 0; var container; +var detail; + function onReady() { - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() + detail = document.getElementById("pixi"); - if(webgl) - { - renderer = new PIXI.WebGLRenderer(); - } - else - { - renderer = new PIXI.CanvasRenderer(480, 320); - } + renderer = PIXI.autoDetectRenderer(); stage = new PIXI.Stage; @@ -46,7 +41,7 @@ stats.domElement.style.top = "0px"; requestAnimFrame(update); - wabbitTexture = new PIXI.Texture("wabbit.png") + wabbitTexture = new PIXI.Texture.fromImage("wabbit.png") counter = document.createElement("div"); counter.className = "counter"; @@ -55,7 +50,6 @@ count = startBunnyCount; counter.innerHTML = count + " BUNNIES"; - container = new PIXI.DisplayObjectContainer(); stage.addChild(container); @@ -114,7 +108,9 @@ minX = 0; maxY = height; minY = 0; - + + detail.style.left = width - 204 + "px"; + detail.style.top = height - 100 + "px"; renderer.resize(width, height); } @@ -126,17 +122,17 @@ { // add 10 at a time :) - for (var i = 0; i < 2; i++) + for (var i = 0; i < 10; i++) { - var bunny = new PIXI.Sprite(wabbitTexture, {x:0, y:0, width:26, height:37}); + var bunny = new PIXI.Sprite(wabbitTexture); bunny.speedX = Math.random() * 10; bunny.speedY = (Math.random() * 10) - 5; bunny.anchor.x = 0.5; bunny.anchor.y = 1; - bunny.alpha = 0.3 + Math.random() * 0.7; + //bunny.alpha = 0.3 + Math.random() * 0.7; bunnys.push(bunny); - bunny.rotation = Math.random() - 0.5; + //bunny.rotation = Math.random() - 0.5; container.addChild(bunny); count++; diff --git a/examples/bunny benchmark/js/pixi.js b/examples/bunny benchmark/js/pixi.js new file mode 100644 index 0000000..65add09 --- /dev/null +++ b/examples/bunny benchmark/js/pixi.js @@ -0,0 +1,110 @@ +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, +d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* +j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= +a[0]-d[0],c=a[1]-d[1];a=a[2]-d[2];d=Math.sqrt(b*b+c*c+a*a);if(!d)return j[0]=0,j[1]=0,j[2]=0,j;d=1/d;j[0]=b*d;j[1]=c*d;j[2]=a*d;return j},lerp:function(a,d,j,b){b||(b=a);b[0]=a[0]+j*(d[0]-a[0]);b[1]=a[1]+j*(d[1]-a[1]);b[2]=a[2]+j*(d[2]-a[2]);return b},dist:function(a,d){var j=d[0]-a[0],b=d[1]-a[1],c=d[2]-a[2];return Math.sqrt(j*j+b*b+c*c)}},p=null,q=new k(4);l.unproject=function(a,d,j,b,c){c||(c=a);p||(p=t.create());var e=p;q[0]=2*(a[0]-b[0])/b[2]-1;q[1]=2*(a[1]-b[1])/b[3]-1;q[2]=2*a[2]-1;q[3]=1; +t.multiply(j,d,e);if(!t.inverse(e))return null;t.multiplyVec4(e,q);if(0===q[3])return null;c[0]=q[0]/q[3];c[1]=q[1]/q[3];c[2]=q[2]/q[3];return c};var C=l.createFrom(1,0,0),F=l.createFrom(0,1,0),u=l.createFrom(0,0,1),w=l.create();l.rotationTo=function(a,d,j){j||(j=m.create());var b=l.dot(a,d);if(1<=b)m.set(H,j);else if(-0.999999>b)l.cross(C,a,w),1E-6>l.length(w)&&l.cross(F,a,w),1E-6>l.length(w)&&l.cross(u,a,w),l.normalize(w),m.fromAngleAxis(Math.PI,w,j);else{var b=Math.sqrt(2*(1+b)),c=1/b;l.cross(a, +d,w);j[0]=w[0]*c;j[1]=w[1]*c;j[2]=w[2]*c;j[3]=0.5*b;m.normalize(j)}1j[3]&&(j[3]=-1);return j};l.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var x={create:function(a){var d=new k(9);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8]):d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=0;return d},createFrom:function(a,d,j,b,c,e,n,f,E){var s=new k(9);s[0]=a;s[1]=d;s[2]=j;s[3]=b;s[4]=c;s[5]=e;s[6]=n;s[7]=f;s[8]=E;return s},determinant:function(a){var d= +a[3],j=a[4],b=a[5],c=a[6],e=a[7],n=a[8];return a[0]*(n*j-b*e)+a[1]*(-n*d+b*c)+a[2]*(e*d-j*c)},inverse:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[3],n=a[4],f=a[5],E=a[6],s=a[7],I=a[8],g=I*n-f*s,h=-I*e+f*E,k=s*e-n*E,r=j*g+b*h+c*k;if(!r)return null;r=1/r;d||(d=x.create());d[0]=g*r;d[1]=(-I*b+c*s)*r;d[2]=(f*b-c*n)*r;d[3]=h*r;d[4]=(I*j-c*E)*r;d[5]=(-f*j+c*e)*r;d[6]=k*r;d[7]=(-s*j+b*E)*r;d[8]=(n*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],D=a[4],E=a[5],s=a[6],I= +a[7];a=a[8];var g=d[0],h=d[1],k=d[2],r=d[3],m=d[4],l=d[5],q=d[6],v=d[7];d=d[8];j[0]=g*b+h*f+k*s;j[1]=g*c+h*D+k*I;j[2]=g*e+h*E+k*a;j[3]=r*b+m*f+l*s;j[4]=r*c+m*D+l*I;j[5]=r*e+m*E+l*a;j[6]=q*b+v*f+d*s;j[7]=q*c+v*D+d*I;j[8]=q*e+v*E+d*a;return j},multiplyVec2:function(a,d,j){j||(j=d);var b=d[0];d=d[1];j[0]=b*a[0]+d*a[3]+a[6];j[1]=b*a[1]+d*a[4]+a[7];return j},multiplyVec3:function(a,d,j){j||(j=d);var b=d[0],c=d[1];d=d[2];j[0]=b*a[0]+c*a[3]+d*a[6];j[1]=b*a[1]+c*a[4]+d*a[7];j[2]=b*a[2]+c*a[5]+d*a[8];return j}, +set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])},identity:function(a){a||(a=x.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, +d){if(!d||a===d){var j=a[1],b=a[2],c=a[5];a[1]=a[3];a[2]=a[6];a[3]=j;a[5]=a[7];a[6]=b;a[7]=c;return a}d[0]=a[0];d[1]=a[3];d[2]=a[6];d[3]=a[1];d[4]=a[4];d[5]=a[7];d[6]=a[2];d[7]=a[5];d[8]=a[8];return d},toMat4:function(a,d){d||(d=t.create());d[15]=1;d[14]=0;d[13]=0;d[12]=0;d[11]=0;d[10]=a[8];d[9]=a[7];d[8]=a[6];d[7]=0;d[6]=a[5];d[5]=a[4];d[4]=a[3];d[3]=0;d[2]=a[2];d[1]=a[1];d[0]=a[0];return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ +a[8]+"]"}},t={create:function(a){var d=new k(16);a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8],d[9]=a[9],d[10]=a[10],d[11]=a[11],d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d},createFrom:function(a,d,j,b,c,e,f,D,E,s,g,h,m,l,r,q){var A=new k(16);A[0]=a;A[1]=d;A[2]=j;A[3]=b;A[4]=c;A[5]=e;A[6]=f;A[7]=D;A[8]=E;A[9]=s;A[10]=g;A[11]=h;A[12]=m;A[13]=l;A[14]=r;A[15]=q;return A},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4]; +d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=a[12];d[13]=a[13];d[14]=a[14];d[15]=a[15];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])&&1E-6>Math.abs(a[9]-d[9])&&1E-6>Math.abs(a[10]-d[10])&&1E-6>Math.abs(a[11]-d[11])&&1E-6>Math.abs(a[12]- +d[12])&&1E-6>Math.abs(a[13]-d[13])&&1E-6>Math.abs(a[14]-d[14])&&1E-6>Math.abs(a[15]-d[15])},identity:function(a){a||(a=t.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,d){if(!d||a===d){var j=a[1],b=a[2],c=a[3],e=a[6],f=a[7],D=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=j;a[6]=a[9];a[7]=a[13];a[8]=b;a[9]=e;a[11]=a[14];a[12]=c;a[13]=f;a[14]=D;return a}d[0]=a[0];d[1]=a[4];d[2]=a[8];d[3]=a[12]; +d[4]=a[1];d[5]=a[5];d[6]=a[9];d[7]=a[13];d[8]=a[2];d[9]=a[6];d[10]=a[10];d[11]=a[14];d[12]=a[3];d[13]=a[7];d[14]=a[11];d[15]=a[15];return d},determinant:function(a){var d=a[0],j=a[1],b=a[2],c=a[3],e=a[4],f=a[5],D=a[6],E=a[7],s=a[8],g=a[9],h=a[10],k=a[11],m=a[12],r=a[13],l=a[14];a=a[15];return m*g*D*c-s*r*D*c-m*f*h*c+e*r*h*c+s*f*l*c-e*g*l*c-m*g*b*E+s*r*b*E+m*j*h*E-d*r*h*E-s*j*l*E+d*g*l*E+m*f*b*k-e*r*b*k-m*j*D*k+d*r*D*k+e*j*l*k-d*f*l*k-s*f*b*a+e*g*b*a+s*j*D*a-d*g*D*a-e*j*h*a+d*f*h*a},inverse:function(a, +d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=a[3],f=a[4],D=a[5],E=a[6],s=a[7],g=a[8],h=a[9],k=a[10],m=a[11],r=a[12],l=a[13],A=a[14],q=a[15],v=j*D-b*f,J=j*E-c*f,y=j*s-e*f,z=b*E-c*D,t=b*s-e*D,u=c*s-e*E,p=g*l-h*r,w=g*A-k*r,x=g*q-m*r,B=h*A-k*l,C=h*q-m*l,F=k*q-m*A,G=v*F-J*C+y*B+z*x-t*w+u*p;if(!G)return null;G=1/G;d[0]=(D*F-E*C+s*B)*G;d[1]=(-b*F+c*C-e*B)*G;d[2]=(l*u-A*t+q*z)*G;d[3]=(-h*u+k*t-m*z)*G;d[4]=(-f*F+E*x-s*w)*G;d[5]=(j*F-c*x+e*w)*G;d[6]=(-r*u+A*y-q*J)*G;d[7]=(g*u-k*y+m*J)*G;d[8]=(f*C-D*x+s*p)*G;d[9]= +(-j*C+b*x-e*p)*G;d[10]=(r*t-l*y+q*v)*G;d[11]=(-g*t+h*y-m*v)*G;d[12]=(-f*B+D*w-E*p)*G;d[13]=(j*B-b*w+c*p)*G;d[14]=(-r*z+l*J-A*v)*G;d[15]=(g*z-h*J+k*v)*G;return d},toRotationMat:function(a,d){d||(d=t.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d},toMat3:function(a,d){d||(d=x.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[4];d[4]=a[5];d[5]=a[6];d[6]=a[8];d[7]=a[9];d[8]=a[10]; +return d},toInverseMat3:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[4],f=a[5],D=a[6],g=a[8],s=a[9],h=a[10],k=h*f-D*s,m=-h*e+D*g,l=s*e-f*g,r=j*k+b*m+c*l;if(!r)return null;r=1/r;d||(d=x.create());d[0]=k*r;d[1]=(-h*b+c*s)*r;d[2]=(D*b-c*f)*r;d[3]=m*r;d[4]=(h*j-c*g)*r;d[5]=(-D*j+c*e)*r;d[6]=l*r;d[7]=(-s*j+b*g)*r;d[8]=(f*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],s=a[6],k=a[7],m=a[8],l=a[9],q=a[10],r=a[11],t=a[12],A=a[13],u=a[14];a=a[15];var v=d[0], +p=d[1],y=d[2],z=d[3];j[0]=v*b+p*g+y*m+z*t;j[1]=v*c+p*h+y*l+z*A;j[2]=v*e+p*s+y*q+z*u;j[3]=v*f+p*k+y*r+z*a;v=d[4];p=d[5];y=d[6];z=d[7];j[4]=v*b+p*g+y*m+z*t;j[5]=v*c+p*h+y*l+z*A;j[6]=v*e+p*s+y*q+z*u;j[7]=v*f+p*k+y*r+z*a;v=d[8];p=d[9];y=d[10];z=d[11];j[8]=v*b+p*g+y*m+z*t;j[9]=v*c+p*h+y*l+z*A;j[10]=v*e+p*s+y*q+z*u;j[11]=v*f+p*k+y*r+z*a;v=d[12];p=d[13];y=d[14];z=d[15];j[12]=v*b+p*g+y*m+z*t;j[13]=v*c+p*h+y*l+z*A;j[14]=v*e+p*s+y*q+z*u;j[15]=v*f+p*k+y*r+z*a;return j},multiplyVec3:function(a,d,b){b||(b=d); +var c=d[0],e=d[1];d=d[2];b[0]=a[0]*c+a[4]*e+a[8]*d+a[12];b[1]=a[1]*c+a[5]*e+a[9]*d+a[13];b[2]=a[2]*c+a[6]*e+a[10]*d+a[14];return b},multiplyVec4:function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=d[3];b[0]=a[0]*c+a[4]*e+a[8]*f+a[12]*d;b[1]=a[1]*c+a[5]*e+a[9]*f+a[13]*d;b[2]=a[2]*c+a[6]*e+a[10]*f+a[14]*d;b[3]=a[3]*c+a[7]*e+a[11]*f+a[15]*d;return b},translate:function(a,d,b){var c=d[0],e=d[1];d=d[2];var f,n,g,h,s,k,m,l,p,r,q,t;if(!b||a===b)return a[12]=a[0]*c+a[4]*e+a[8]*d+a[12],a[13]=a[1]*c+a[5]*e+ +a[9]*d+a[13],a[14]=a[2]*c+a[6]*e+a[10]*d+a[14],a[15]=a[3]*c+a[7]*e+a[11]*d+a[15],a;f=a[0];n=a[1];g=a[2];h=a[3];s=a[4];k=a[5];m=a[6];l=a[7];p=a[8];r=a[9];q=a[10];t=a[11];b[0]=f;b[1]=n;b[2]=g;b[3]=h;b[4]=s;b[5]=k;b[6]=m;b[7]=l;b[8]=p;b[9]=r;b[10]=q;b[11]=t;b[12]=f*c+s*e+p*d+a[12];b[13]=n*c+k*e+r*d+a[13];b[14]=g*c+m*e+q*d+a[14];b[15]=h*c+l*e+t*d+a[15];return b},scale:function(a,d,b){var c=d[0],e=d[1];d=d[2];if(!b||a===b)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=d,a[9]*= +d,a[10]*=d,a[11]*=d,a;b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[7]=a[7]*e;b[8]=a[8]*d;b[9]=a[9]*d;b[10]=a[10]*d;b[11]=a[11]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},rotate:function(a,d,b,c){var e=b[0],f=b[1];b=b[2];var n=Math.sqrt(e*e+f*f+b*b),g,h,k,m,l,p,q,r,t,u,w,v,x,y,z,B,C,F,H,K;if(!n)return null;1!==n&&(n=1/n,e*=n,f*=n,b*=n);g=Math.sin(d);h=Math.cos(d);k=1-h;d=a[0];n=a[1];m=a[2];l=a[3];p=a[4];q=a[5];r=a[6];t=a[7];u=a[8];w=a[9];v= +a[10];x=a[11];y=e*e*k+h;z=f*e*k+b*g;B=b*e*k-f*g;C=e*f*k-b*g;F=f*f*k+h;H=b*f*k+e*g;K=e*b*k+f*g;e=f*b*k-e*g;f=b*b*k+h;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=d*y+p*z+u*B;c[1]=n*y+q*z+w*B;c[2]=m*y+r*z+v*B;c[3]=l*y+t*z+x*B;c[4]=d*C+p*F+u*H;c[5]=n*C+q*F+w*H;c[6]=m*C+r*F+v*H;c[7]=l*C+t*F+x*H;c[8]=d*K+p*e+u*f;c[9]=n*K+q*e+w*f;c[10]=m*K+r*e+v*f;c[11]=l*K+t*e+x*f;return c},rotateX:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[4],f=a[5],n=a[6],g=a[7],h=a[8],k=a[9],m=a[10], +l=a[11];b?a!==b&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[4]=e*d+h*c;b[5]=f*d+k*c;b[6]=n*d+m*c;b[7]=g*d+l*c;b[8]=e*-c+h*d;b[9]=f*-c+k*d;b[10]=n*-c+m*d;b[11]=g*-c+l*d;return b},rotateY:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[8],k=a[9],m=a[10],l=a[11];b?a!==b&&(b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*-c;b[1]=f*d+k*-c;b[2]=n*d+m*-c;b[3]=g* +d+l*-c;b[8]=e*c+h*d;b[9]=f*c+k*d;b[10]=n*c+m*d;b[11]=g*c+l*d;return b},rotateZ:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[4],k=a[5],m=a[6],l=a[7];b?a!==b&&(b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*c;b[1]=f*d+k*c;b[2]=n*d+m*c;b[3]=g*d+l*c;b[4]=e*-c+h*d;b[5]=f*-c+k*d;b[6]=n*-c+m*d;b[7]=g*-c+l*d;return b},frustum:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2*e/g;n[1]=0; +n[2]=0;n[3]=0;n[4]=0;n[5]=2*e/h;n[6]=0;n[7]=0;n[8]=(d+a)/g;n[9]=(c+b)/h;n[10]=-(f+e)/k;n[11]=-1;n[12]=0;n[13]=0;n[14]=-(2*f*e)/k;n[15]=0;return n},perspective:function(a,d,b,c,e){a=b*Math.tan(a*Math.PI/360);d*=a;return t.frustum(-d,d,-a,a,b,c,e)},ortho:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2/g;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=2/h;n[6]=0;n[7]=0;n[8]=0;n[9]=0;n[10]=-2/k;n[11]=0;n[12]=-(a+d)/g;n[13]=-(c+b)/h;n[14]=-(f+e)/k;n[15]=1;return n},lookAt:function(a,d,b,c){c|| +(c=t.create());var e,f,n,g,h,k,m,l,p=a[0],q=a[1];a=a[2];n=b[0];g=b[1];f=b[2];m=d[0];b=d[1];e=d[2];if(p===m&&q===b&&a===e)return t.identity(c);d=p-m;b=q-b;m=a-e;l=1/Math.sqrt(d*d+b*b+m*m);d*=l;b*=l;m*=l;e=g*m-f*b;f=f*d-n*m;n=n*b-g*d;(l=Math.sqrt(e*e+f*f+n*n))?(l=1/l,e*=l,f*=l,n*=l):n=f=e=0;g=b*n-m*f;h=m*e-d*n;k=d*f-b*e;(l=Math.sqrt(g*g+h*h+k*k))?(l=1/l,g*=l,h*=l,k*=l):k=h=g=0;c[0]=e;c[1]=g;c[2]=d;c[3]=0;c[4]=f;c[5]=h;c[6]=b;c[7]=0;c[8]=n;c[9]=k;c[10]=m;c[11]=0;c[12]=-(e*p+f*q+n*a);c[13]=-(g*p+h*q+ +k*a);c[14]=-(d*p+b*q+m*a);c[15]=1;return c},fromRotationTranslation:function(a,d,b){b||(b=t.create());var c=a[0],e=a[1],f=a[2],n=a[3],g=c+c,h=e+e,k=f+f;a=c*g;var l=c*h,c=c*k,m=e*h,e=e*k,f=f*k,g=n*g,h=n*h,n=n*k;b[0]=1-(m+f);b[1]=l+n;b[2]=c-h;b[3]=0;b[4]=l-n;b[5]=1-(a+f);b[6]=e+g;b[7]=0;b[8]=c+h;b[9]=e-g;b[10]=1-(a+m);b[11]=0;b[12]=d[0];b[13]=d[1];b[14]=d[2];b[15]=1;return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ +a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},m={create:function(a){var d=new k(4);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]):d[0]=d[1]=d[2]=d[3]=0;return d},createFrom:function(a,d,b,c){var e=new k(4);e[0]=a;e[1]=d;e[2]=b;e[3]=c;return e},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])},identity:function(a){a||(a=m.create()); +a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},H=m.identity();m.calculateW=function(a,d){var b=a[0],c=a[1],e=a[2];if(!d||a===d)return a[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e)),a;d[0]=b;d[1]=c;d[2]=e;d[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e));return d};m.dot=function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3]};m.inverse=function(a,d){var b=a[0],c=a[1],e=a[2],f=a[3],b=(b=b*b+c*c+e*e+f*f)?1/b:0;if(!d||a===d)return a[0]*=-b,a[1]*=-b,a[2]*=-b,a[3]*=b,a;d[0]=-a[0]*b;d[1]=-a[1]*b;d[2]=-a[2]*b;d[3]=a[3]*b; +return d};m.conjugate=function(a,d){if(!d||a===d)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=a[3];return d};m.length=function(a){var d=a[0],b=a[1],c=a[2];a=a[3];return Math.sqrt(d*d+b*b+c*c+a*a)};m.normalize=function(a,d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=Math.sqrt(b*b+c*c+e*e+f*f);if(0===g)return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d;g=1/g;d[0]=b*g;d[1]=c*g;d[2]=e*g;d[3]=f*g;return d};m.add=function(a,d,b){if(!b||a===b)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a[3]+= +d[3],a;b[0]=a[0]+d[0];b[1]=a[1]+d[1];b[2]=a[2]+d[2];b[3]=a[3]+d[3];return b};m.multiply=function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2];a=a[3];var g=d[0],h=d[1],k=d[2];d=d[3];b[0]=c*d+a*g+e*k-f*h;b[1]=e*d+a*h+f*g-c*k;b[2]=f*d+a*k+c*h-e*g;b[3]=a*d-c*g-e*h-f*k;return b};m.multiplyVec3=function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=a[0];var g=a[1],h=a[2];a=a[3];var k=a*c+g*f-h*e,l=a*e+h*c-d*f,m=a*f+d*e-g*c,c=-d*c-g*e-h*f;b[0]=k*a+c*-d+l*-h-m*-g;b[1]=l*a+c*-g+m*-d-k*-h;b[2]=m*a+c*-h+k*-g-l*-d; +return b};m.scale=function(a,d,b){if(!b||a===b)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a;b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[3]=a[3]*d;return b};m.toMat3=function(a,d){d||(d=x.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b*k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=m-f;d[4]=1-(l+e);d[5]=c+g;d[6]=b+h;d[7]=c-g;d[8]=1-(l+p);return d};m.toMat4=function(a,d){d||(d=t.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b* +k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=0;d[4]=m-f;d[5]=1-(l+e);d[6]=c+g;d[7]=0;d[8]=b+h;d[9]=c-g;d[10]=1-(l+p);d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d};m.slerp=function(a,d,b,c){c||(c=a);var e=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3],f,g;if(1<=Math.abs(e))return c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]),c;f=Math.acos(e);g=Math.sqrt(1-e*e);if(0.0010>Math.abs(g))return c[0]=0.5*a[0]+0.5*d[0],c[1]=0.5*a[1]+0.5*d[1],c[2]=0.5*a[2]+0.5*d[2],c[3]=0.5*a[3]+ +0.5*d[3],c;e=Math.sin((1-b)*f)/g;b=Math.sin(b*f)/g;c[0]=a[0]*e+d[0]*b;c[1]=a[1]*e+d[1]*b;c[2]=a[2]*e+d[2]*b;c[3]=a[3]*e+d[3]*b;return c};m.fromRotationMatrix=function(a,d){d||(d=m.create());var b=a[0]+a[4]+a[8],c;if(0a[0]&&(b=1);a[8]>a[3*b+b]&&(b=2);var e=c[b],f=c[e];c=Math.sqrt(a[3*b+b]-a[3*e+e]-a[3*f+f]+1);d[b]=0.5*c;c= +0.5/c;d[3]=(a[3*f+e]-a[3*e+f])*c;d[e]=(a[3*e+b]+a[3*b+e])*c;d[f]=(a[3*f+b]+a[3*b+f])*c}return d};x.toQuat4=m.fromRotationMatrix;var B=x.create();m.fromAxes=function(a,d,b,c){B[0]=d[0];B[3]=d[1];B[6]=d[2];B[1]=b[0];B[4]=b[1];B[7]=b[2];B[2]=a[0];B[5]=a[1];B[8]=a[2];return m.fromRotationMatrix(B,c)};m.identity=function(a){a||(a=m.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};m.fromAngleAxis=function(a,d,b){b||(b=m.create());a*=0.5;var c=Math.sin(a);b[3]=Math.cos(a);b[0]=c*d[0];b[1]=c*d[1];b[2]=c*d[2]; +return b};m.toAngleAxis=function(a,d){d||(d=a);var b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); +b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 +Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],e=a[1],f=a[2],g=a[3],h=c*g-f*e;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-e*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, +b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];c[0]=e*b[0]+f*b[2];c[1]=e*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=e*b+f*h;c[1]=e*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var e=b[0];b=b[1];c[0]=e*a[0]+b*a[1];c[1]=e*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var e=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=e*b;c[2]=f*h;c[3]= +g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, +b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| +(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= +f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; +PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; +PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l>1);var b=m[0];return b*(1.5-0.5*a*b*b)}}else g.invsqrt=function(a){return 1/Math.sqrt(a)}; -var l=null;f();var j={create:function(a){var b=new l(3);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0;return b},createFrom:function(a,b,e){var c=new l(3);c[0]=a;c[1]=b;c[2]=e;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])},add:function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];return e},subtract:function(a, -b,e){if(!e||a===e)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];return e},multiply:function(a,b,e){if(!e||a===e)return a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a;e[0]=a[0]*b[0];e[1]=a[1]*b[1];e[2]=a[2]*b[2];return e},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;return e},normalize:function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=Math.sqrt(e* -e+c*c+d*d);if(!k)return b[0]=0,b[1]=0,b[2]=0,b;if(1===k)return b[0]=e,b[1]=c,b[2]=d,b;k=1/k;b[0]=e*k;b[1]=c*k;b[2]=d*k;return b},cross:function(a,b,e){e||(e=a);var c=a[0],d=a[1];a=a[2];var k=b[0],h=b[1];b=b[2];e[0]=d*b-a*h;e[1]=a*k-c*b;e[2]=c*h-d*k;return e},length:function(a){var b=a[0],e=a[1];a=a[2];return Math.sqrt(b*b+e*e+a*a)},squaredLength:function(a){var b=a[0],e=a[1];a=a[2];return b*b+e*e+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,b,e){e||(e=a);var c= -a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];b=Math.sqrt(c*c+d*d+a*a);if(!b)return e[0]=0,e[1]=0,e[2]=0,e;b=1/b;e[0]=c*b;e[1]=d*b;e[2]=a*b;return e},lerp:function(a,b,e,c){c||(c=a);c[0]=a[0]+e*(b[0]-a[0]);c[1]=a[1]+e*(b[1]-a[1]);c[2]=a[2]+e*(b[2]-a[2]);return c},dist:function(a,b){var e=b[0]-a[0],c=b[1]-a[1],d=b[2]-a[2];return Math.sqrt(e*e+c*c+d*d)}},x=null,n=new l(4);j.unproject=function(a,b,e,c,d){d||(d=a);x||(x=y.create());var k=x;n[0]=2*(a[0]-c[0])/c[2]-1;n[1]=2*(a[1]-c[1])/c[3]-1;n[2]=2*a[2]-1;n[3]=1; -y.multiply(e,b,k);if(!y.inverse(k))return null;y.multiplyVec4(k,n);if(0===n[3])return null;d[0]=n[0]/n[3];d[1]=n[1]/n[3];d[2]=n[2]/n[3];return d};var z=j.createFrom(1,0,0),A=j.createFrom(0,1,0),H=j.createFrom(0,0,1),C=j.create();j.rotationTo=function(a,b,e){e||(e=s.create());var c=j.dot(a,b);if(1<=c)s.set(O,e);else if(-0.999999>c)j.cross(z,a,C),1E-6>j.length(C)&&j.cross(A,a,C),1E-6>j.length(C)&&j.cross(H,a,C),j.normalize(C),s.fromAngleAxis(Math.PI,C,e);else{var c=Math.sqrt(2*(1+c)),d=1/c;j.cross(a, -b,C);e[0]=C[0]*d;e[1]=C[1]*d;e[2]=C[2]*d;e[3]=0.5*c;s.normalize(e)}1e[3]&&(e[3]=-1);return e};j.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var F={create:function(a){var b=new l(9);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0;return b},createFrom:function(a,b,e,c,d,k,h,E,K){var q=new l(9);q[0]=a;q[1]=b;q[2]=e;q[3]=c;q[4]=d;q[5]=k;q[6]=h;q[7]=E;q[8]=K;return q},determinant:function(a){var b= -a[3],e=a[4],c=a[5],d=a[6],k=a[7],h=a[8];return a[0]*(h*e-c*k)+a[1]*(-h*b+c*d)+a[2]*(k*b-e*d)},inverse:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],E=a[5],K=a[6],q=a[7],f=a[8],g=f*h-E*q,j=-f*k+E*K,J=q*k-h*K,r=e*g+c*j+d*J;if(!r)return null;r=1/r;b||(b=F.create());b[0]=g*r;b[1]=(-f*c+d*q)*r;b[2]=(E*c-d*h)*r;b[3]=j*r;b[4]=(f*e-d*K)*r;b[5]=(-E*e+d*k)*r;b[6]=J*r;b[7]=(-q*e+c*K)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],E=a[4],f=a[5],q=a[6],g= -a[7];a=a[8];var u=b[0],j=b[1],J=b[2],r=b[3],l=b[4],t=b[5],m=b[6],p=b[7];b=b[8];e[0]=u*c+j*h+J*q;e[1]=u*d+j*E+J*g;e[2]=u*k+j*f+J*a;e[3]=r*c+l*h+t*q;e[4]=r*d+l*E+t*g;e[5]=r*k+l*f+t*a;e[6]=m*c+p*h+b*q;e[7]=m*d+p*E+b*g;e[8]=m*k+p*f+b*a;return e},multiplyVec2:function(a,b,e){e||(e=b);var c=b[0];b=b[1];e[0]=c*a[0]+b*a[3]+a[6];e[1]=c*a[1]+b*a[4]+a[7];return e},multiplyVec3:function(a,b,e){e||(e=b);var c=b[0],d=b[1];b=b[2];e[0]=c*a[0]+d*a[3]+b*a[6];e[1]=c*a[1]+d*a[4]+b*a[7];e[2]=c*a[2]+d*a[5]+b*a[8];return e}, -set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])},identity:function(a){a||(a=F.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, -b){if(!b||a===b){var e=a[1],c=a[2],d=a[5];a[1]=a[3];a[2]=a[6];a[3]=e;a[5]=a[7];a[6]=c;a[7]=d;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]=a[8];return b},toMat4:function(a,b){b||(b=y.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ -a[8]+"]"}},y={create:function(a){var b=new l(16);a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]);return b},createFrom:function(a,b,e,c,d,k,h,E,f,q,g,u,j,J,r,m){var t=new l(16);t[0]=a;t[1]=b;t[2]=e;t[3]=c;t[4]=d;t[5]=k;t[6]=h;t[7]=E;t[8]=f;t[9]=q;t[10]=g;t[11]=u;t[12]=j;t[13]=J;t[14]=r;t[15]=m;return t},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4]; -b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])&&1E-6>Math.abs(a[9]-b[9])&&1E-6>Math.abs(a[10]-b[10])&&1E-6>Math.abs(a[11]-b[11])&&1E-6>Math.abs(a[12]- -b[12])&&1E-6>Math.abs(a[13]-b[13])&&1E-6>Math.abs(a[14]-b[14])&&1E-6>Math.abs(a[15]-b[15])},identity:function(a){a||(a=y.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){var e=a[1],c=a[2],d=a[3],k=a[6],h=a[7],E=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=e;a[6]=a[9];a[7]=a[13];a[8]=c;a[9]=k;a[11]=a[14];a[12]=d;a[13]=h;a[14]=E;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12]; -b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b=a[0],e=a[1],c=a[2],d=a[3],k=a[4],h=a[5],E=a[6],f=a[7],g=a[8],I=a[9],u=a[10],j=a[11],l=a[12],r=a[13],m=a[14];a=a[15];return l*I*E*d-g*r*E*d-l*h*u*d+k*r*u*d+g*h*m*d-k*I*m*d-l*I*c*f+g*r*c*f+l*e*u*f-b*r*u*f-g*e*m*f+b*I*m*f+l*h*c*j-k*r*c*j-l*e*E*j+b*r*E*j+k*e*m*j-b*h*m*j-g*h*c*a+k*I*c*a+g*e*E*a-b*I*E*a-k*e*u*a+b*h*u*a},inverse:function(a, -b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],f=a[5],g=a[6],q=a[7],I=a[8],u=a[9],j=a[10],l=a[11],r=a[12],m=a[13],t=a[14],p=a[15],s=e*f-c*h,n=e*g-d*h,v=e*q-k*h,w=c*g-d*f,x=c*q-k*f,y=d*q-k*g,z=I*m-u*r,A=I*t-j*r,C=I*p-l*r,D=u*t-j*m,F=u*p-l*m,H=j*p-l*t,G=s*H-n*F+v*D+w*C-x*A+y*z;if(!G)return null;G=1/G;b[0]=(f*H-g*F+q*D)*G;b[1]=(-c*H+d*F-k*D)*G;b[2]=(m*y-t*x+p*w)*G;b[3]=(-u*y+j*x-l*w)*G;b[4]=(-h*H+g*C-q*A)*G;b[5]=(e*H-d*C+k*A)*G;b[6]=(-r*y+t*v-p*n)*G;b[7]=(I*y-j*v+l*n)*G;b[8]=(h*F-f*C+q*z)*G;b[9]= -(-e*F+c*C-k*z)*G;b[10]=(r*x-m*v+p*s)*G;b[11]=(-I*x+u*v-l*s)*G;b[12]=(-h*D+f*A-g*z)*G;b[13]=(e*D-c*A+d*z)*G;b[14]=(-r*w+m*n-t*s)*G;b[15]=(I*w-u*n+j*s)*G;return b},toRotationMat:function(a,b){b||(b=y.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=F.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10]; -return b},toInverseMat3:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[4],h=a[5],f=a[6],g=a[8],q=a[9],j=a[10],u=j*h-f*q,l=-j*k+f*g,m=q*k-h*g,r=e*u+c*l+d*m;if(!r)return null;r=1/r;b||(b=F.create());b[0]=u*r;b[1]=(-j*c+d*q)*r;b[2]=(f*c-d*h)*r;b[3]=l*r;b[4]=(j*e-d*g)*r;b[5]=(-f*e+d*k)*r;b[6]=m*r;b[7]=(-q*e+c*g)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],f=a[4],g=a[5],q=a[6],j=a[7],u=a[8],l=a[9],m=a[10],r=a[11],p=a[12],t=a[13],s=a[14];a=a[15];var n=b[0], -B=b[1],v=b[2],w=b[3];e[0]=n*c+B*f+v*u+w*p;e[1]=n*d+B*g+v*l+w*t;e[2]=n*k+B*q+v*m+w*s;e[3]=n*h+B*j+v*r+w*a;n=b[4];B=b[5];v=b[6];w=b[7];e[4]=n*c+B*f+v*u+w*p;e[5]=n*d+B*g+v*l+w*t;e[6]=n*k+B*q+v*m+w*s;e[7]=n*h+B*j+v*r+w*a;n=b[8];B=b[9];v=b[10];w=b[11];e[8]=n*c+B*f+v*u+w*p;e[9]=n*d+B*g+v*l+w*t;e[10]=n*k+B*q+v*m+w*s;e[11]=n*h+B*j+v*r+w*a;n=b[12];B=b[13];v=b[14];w=b[15];e[12]=n*c+B*f+v*u+w*p;e[13]=n*d+B*g+v*l+w*t;e[14]=n*k+B*q+v*m+w*s;e[15]=n*h+B*j+v*r+w*a;return e},multiplyVec3:function(a,b,e){e||(e=b); -var c=b[0],d=b[1];b=b[2];e[0]=a[0]*c+a[4]*d+a[8]*b+a[12];e[1]=a[1]*c+a[5]*d+a[9]*b+a[13];e[2]=a[2]*c+a[6]*d+a[10]*b+a[14];return e},multiplyVec4:function(a,b,e){e||(e=b);var c=b[0],d=b[1],k=b[2];b=b[3];e[0]=a[0]*c+a[4]*d+a[8]*k+a[12]*b;e[1]=a[1]*c+a[5]*d+a[9]*k+a[13]*b;e[2]=a[2]*c+a[6]*d+a[10]*k+a[14]*b;e[3]=a[3]*c+a[7]*d+a[11]*k+a[15]*b;return e},translate:function(a,b,e){var c=b[0],d=b[1];b=b[2];var k,h,f,g,q,j,u,l,m,n,p,s;if(!e||a===e)return a[12]=a[0]*c+a[4]*d+a[8]*b+a[12],a[13]=a[1]*c+a[5]*d+ -a[9]*b+a[13],a[14]=a[2]*c+a[6]*d+a[10]*b+a[14],a[15]=a[3]*c+a[7]*d+a[11]*b+a[15],a;k=a[0];h=a[1];f=a[2];g=a[3];q=a[4];j=a[5];u=a[6];l=a[7];m=a[8];n=a[9];p=a[10];s=a[11];e[0]=k;e[1]=h;e[2]=f;e[3]=g;e[4]=q;e[5]=j;e[6]=u;e[7]=l;e[8]=m;e[9]=n;e[10]=p;e[11]=s;e[12]=k*c+q*d+m*b+a[12];e[13]=h*c+j*d+n*b+a[13];e[14]=f*c+u*d+p*b+a[14];e[15]=g*c+l*d+s*b+a[15];return e},scale:function(a,b,e){var c=b[0],d=b[1];b=b[2];if(!e||a===e)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=d,a[5]*=d,a[6]*=d,a[7]*=d,a[8]*=b,a[9]*= -b,a[10]*=b,a[11]*=b,a;e[0]=a[0]*c;e[1]=a[1]*c;e[2]=a[2]*c;e[3]=a[3]*c;e[4]=a[4]*d;e[5]=a[5]*d;e[6]=a[6]*d;e[7]=a[7]*d;e[8]=a[8]*b;e[9]=a[9]*b;e[10]=a[10]*b;e[11]=a[11]*b;e[12]=a[12];e[13]=a[13];e[14]=a[14];e[15]=a[15];return e},rotate:function(a,b,e,c){var d=e[0],k=e[1];e=e[2];var h=Math.sqrt(d*d+k*k+e*e),f,g,q,j,l,m,n,r,p,s,x,y,B,v,w,z,A,C,D,F;if(!h)return null;1!==h&&(h=1/h,d*=h,k*=h,e*=h);f=Math.sin(b);g=Math.cos(b);q=1-g;b=a[0];h=a[1];j=a[2];l=a[3];m=a[4];n=a[5];r=a[6];p=a[7];s=a[8];x=a[9];y= -a[10];B=a[11];v=d*d*q+g;w=k*d*q+e*f;z=e*d*q-k*f;A=d*k*q-e*f;C=k*k*q+g;D=e*k*q+d*f;F=d*e*q+k*f;d=k*e*q-d*f;k=e*e*q+g;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=b*v+m*w+s*z;c[1]=h*v+n*w+x*z;c[2]=j*v+r*w+y*z;c[3]=l*v+p*w+B*z;c[4]=b*A+m*C+s*D;c[5]=h*A+n*C+x*D;c[6]=j*A+r*C+y*D;c[7]=l*A+p*C+B*D;c[8]=b*F+m*d+s*k;c[9]=h*F+n*d+x*k;c[10]=j*F+r*d+y*k;c[11]=l*F+p*d+B*k;return c},rotateX:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[4],k=a[5],h=a[6],f=a[7],g=a[8],q=a[9],j=a[10], -l=a[11];e?a!==e&&(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[4]=d*b+g*c;e[5]=k*b+q*c;e[6]=h*b+j*c;e[7]=f*b+l*c;e[8]=d*-c+g*b;e[9]=k*-c+q*b;e[10]=h*-c+j*b;e[11]=f*-c+l*b;return e},rotateY:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[8],j=a[9],l=a[10],m=a[11];e?a!==e&&(e[4]=a[4],e[5]=a[5],e[6]=a[6],e[7]=a[7],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*-c;e[1]=k*b+j*-c;e[2]=h*b+l*-c;e[3]=f* -b+m*-c;e[8]=d*c+g*b;e[9]=k*c+j*b;e[10]=h*c+l*b;e[11]=f*c+m*b;return e},rotateZ:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[4],j=a[5],l=a[6],m=a[7];e?a!==e&&(e[8]=a[8],e[9]=a[9],e[10]=a[10],e[11]=a[11],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*c;e[1]=k*b+j*c;e[2]=h*b+l*c;e[3]=f*b+m*c;e[4]=d*-c+g*b;e[5]=k*-c+j*b;e[6]=h*-c+l*b;e[7]=f*-c+m*b;return e},frustum:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2*d/f;h[1]=0; -h[2]=0;h[3]=0;h[4]=0;h[5]=2*d/g;h[6]=0;h[7]=0;h[8]=(b+a)/f;h[9]=(c+e)/g;h[10]=-(k+d)/j;h[11]=-1;h[12]=0;h[13]=0;h[14]=-(2*k*d)/j;h[15]=0;return h},perspective:function(a,b,e,c,d){a=e*Math.tan(a*Math.PI/360);b*=a;return y.frustum(-b,b,-a,a,e,c,d)},ortho:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2/f;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/g;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/j;h[11]=0;h[12]=-(a+b)/f;h[13]=-(c+e)/g;h[14]=-(k+d)/j;h[15]=1;return h},lookAt:function(a,b,e,c){c|| -(c=y.create());var d,k,h,f,g,j,l,m,n=a[0],p=a[1];a=a[2];h=e[0];f=e[1];k=e[2];l=b[0];e=b[1];d=b[2];if(n===l&&p===e&&a===d)return y.identity(c);b=n-l;e=p-e;l=a-d;m=1/Math.sqrt(b*b+e*e+l*l);b*=m;e*=m;l*=m;d=f*l-k*e;k=k*b-h*l;h=h*e-f*b;(m=Math.sqrt(d*d+k*k+h*h))?(m=1/m,d*=m,k*=m,h*=m):h=k=d=0;f=e*h-l*k;g=l*d-b*h;j=b*k-e*d;(m=Math.sqrt(f*f+g*g+j*j))?(m=1/m,f*=m,g*=m,j*=m):j=g=f=0;c[0]=d;c[1]=f;c[2]=b;c[3]=0;c[4]=k;c[5]=g;c[6]=e;c[7]=0;c[8]=h;c[9]=j;c[10]=l;c[11]=0;c[12]=-(d*n+k*p+h*a);c[13]=-(f*n+g*p+ -j*a);c[14]=-(b*n+e*p+l*a);c[15]=1;return c},fromRotationTranslation:function(a,b,e){e||(e=y.create());var c=a[0],d=a[1],k=a[2],h=a[3],f=c+c,g=d+d,j=k+k;a=c*f;var l=c*g,c=c*j,m=d*g,d=d*j,k=k*j,f=h*f,g=h*g,h=h*j;e[0]=1-(m+k);e[1]=l+h;e[2]=c-g;e[3]=0;e[4]=l-h;e[5]=1-(a+k);e[6]=d+f;e[7]=0;e[8]=c+g;e[9]=d-f;e[10]=1-(a+m);e[11]=0;e[12]=b[0];e[13]=b[1];e[14]=b[2];e[15]=1;return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ -a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},s={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,e,c){var d=new l(4);d[0]=a;d[1]=b;d[2]=e;d[3]=c;return d},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=s.create()); -a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},O=s.identity();s.calculateW=function(a,b){var e=a[0],c=a[1],d=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d)),a;b[0]=e;b[1]=c;b[2]=d;b[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d));return b};s.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};s.inverse=function(a,b){var e=a[0],c=a[1],d=a[2],f=a[3],e=(e=e*e+c*c+d*d+f*f)?1/e:0;if(!b||a===b)return a[0]*=-e,a[1]*=-e,a[2]*=-e,a[3]*=e,a;b[0]=-a[0]*e;b[1]=-a[1]*e;b[2]=-a[2]*e;b[3]=a[3]*e; -return b};s.conjugate=function(a,b){if(!b||a===b)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};s.length=function(a){var b=a[0],e=a[1],c=a[2];a=a[3];return Math.sqrt(b*b+e*e+c*c+a*a)};s.normalize=function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],f=a[3],h=Math.sqrt(e*e+c*c+d*d+f*f);if(0===h)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;h=1/h;b[0]=e*h;b[1]=c*h;b[2]=d*h;b[3]=f*h;return b};s.add=function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+= -b[3],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];e[3]=a[3]+b[3];return e};s.multiply=function(a,b,e){e||(e=a);var c=a[0],d=a[1],f=a[2];a=a[3];var h=b[0],g=b[1],j=b[2];b=b[3];e[0]=c*b+a*h+d*j-f*g;e[1]=d*b+a*g+f*h-c*j;e[2]=f*b+a*j+c*g-d*h;e[3]=a*b-c*h-d*g-f*j;return e};s.multiplyVec3=function(a,b,e){e||(e=b);var c=b[0],d=b[1],f=b[2];b=a[0];var h=a[1],g=a[2];a=a[3];var j=a*c+h*f-g*d,l=a*d+g*c-b*f,m=a*f+b*d-h*c,c=-b*c-h*d-g*f;e[0]=j*a+c*-b+l*-g-m*-h;e[1]=l*a+c*-h+m*-b-j*-g;e[2]=m*a+c*-g+j*-h-l*-b; -return e};s.scale=function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a[3]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;e[3]=a[3]*b;return e};s.toMat3=function(a,b){b||(b=F.create());var e=a[0],c=a[1],d=a[2],f=a[3],h=e+e,g=c+c,j=d+d,l=e*h,m=e*g,e=e*j,n=c*g,c=c*j,d=d*j,h=f*h,g=f*g,f=f*j;b[0]=1-(n+d);b[1]=m+f;b[2]=e-g;b[3]=m-f;b[4]=1-(l+d);b[5]=c+h;b[6]=e+g;b[7]=c-h;b[8]=1-(l+n);return b};s.toMat4=function(a,b){b||(b=y.create());var e=a[0],c=a[1],d=a[2],f=a[3],g=e+e,j=c+c,l=d+d,m=e*g,n=e*j,e=e* -l,p=c*j,c=c*l,d=d*l,g=f*g,j=f*j,f=f*l;b[0]=1-(p+d);b[1]=n+f;b[2]=e-j;b[3]=0;b[4]=n-f;b[5]=1-(m+d);b[6]=c+g;b[7]=0;b[8]=e+j;b[9]=c-g;b[10]=1-(m+p);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};s.slerp=function(a,b,c,d){d||(d=a);var f=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],g,h;if(1<=Math.abs(f))return d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d;g=Math.acos(f);h=Math.sqrt(1-f*f);if(0.001>Math.abs(h))return d[0]=0.5*a[0]+0.5*b[0],d[1]=0.5*a[1]+0.5*b[1],d[2]=0.5*a[2]+0.5*b[2],d[3]=0.5*a[3]+ -0.5*b[3],d;f=Math.sin((1-c)*g)/h;c=Math.sin(c*g)/h;d[0]=a[0]*f+b[0]*c;d[1]=a[1]*f+b[1]*c;d[2]=a[2]*f+b[2]*c;d[3]=a[3]*f+b[3]*c;return d};s.fromRotationMatrix=function(a,b){b||(b=s.create());var c=a[0]+a[4]+a[8],d;if(0a[0]&&(c=1);a[8]>a[3*c+c]&&(c=2);var f=d[c],g=d[f];d=Math.sqrt(a[3*c+c]-a[3*f+f]-a[3*g+g]+1);b[c]=0.5*d;d= -0.5/d;b[3]=(a[3*g+f]-a[3*f+g])*d;b[f]=(a[3*f+c]+a[3*c+f])*d;b[g]=(a[3*g+c]+a[3*c+g])*d}return b};F.toQuat4=s.fromRotationMatrix;var D=F.create();s.fromAxes=function(a,b,c,d){D[0]=b[0];D[3]=b[1];D[6]=b[2];D[1]=c[0];D[4]=c[1];D[7]=c[2];D[2]=a[0];D[5]=a[1];D[8]=a[2];return s.fromRotationMatrix(D,d)};s.identity=function(a){a||(a=s.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};s.fromAngleAxis=function(a,b,c){c||(c=s.create());a*=0.5;var d=Math.sin(a);c[3]=Math.cos(a);c[0]=d*b[0];c[1]=d*b[1];c[2]=d*b[2]; -return c};s.toAngleAxis=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); -b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 -Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],f=a[2],g=a[3],h=c*g-f*d;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-d*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, -b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];c[0]=d*b[0]+f*b[2];c[1]=d*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=d*b+f*h;c[1]=d*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var d=b[0];b=b[1];c[0]=d*a[0]+b*a[1];c[1]=d*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var d=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=d*b;c[2]=f*h;c[3]= -g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,d){var f=new l(4);f[0]=a;f[1]=b;f[2]=c;f[3]=d;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, -b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| -(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)},squaredLength:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};c&&(c.glMatrixArrayType=l,c.MatrixArray=l,c.setMatrixArrayType=d,c.determineMatrixArrayType= -f,c.glMath=g,c.vec2=M,c.vec3=j,c.vec4=N,c.mat2=L,c.mat3=F,c.mat4=y,c.quat4=s);return{glMatrixArrayType:l,MatrixArray:l,setMatrixArrayType:d,determineMatrixArrayType:f,glMath:g,vec2:M,vec3:j,vec4:N,mat2:L,mat3:F,mat4:y,quat4:s}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * vColor;","}"]; -PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"]; -PIXI.CompileVertexShader=function(c,d){for(var f="",g=0;g>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/examples/bunny benchmark/index.html b/examples/bunny benchmark/index.html index 7c5521b..95972c4 100644 --- a/examples/bunny benchmark/index.html +++ b/examples/bunny benchmark/index.html @@ -9,9 +9,10 @@ +
    Click to add more bunnys! Let me know how many you get on screen here @doormat23
    - + diff --git a/examples/bunny benchmark/js/bunnyBenchMark.js b/examples/bunny benchmark/js/bunnyBenchMark.js index a3154eb..c3c8ec5 100644 --- a/examples/bunny benchmark/js/bunnyBenchMark.js +++ b/examples/bunny benchmark/js/bunnyBenchMark.js @@ -22,18 +22,13 @@ var count = 0; var container; +var detail; + function onReady() { - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() + detail = document.getElementById("pixi"); - if(webgl) - { - renderer = new PIXI.WebGLRenderer(); - } - else - { - renderer = new PIXI.CanvasRenderer(480, 320); - } + renderer = PIXI.autoDetectRenderer(); stage = new PIXI.Stage; @@ -46,7 +41,7 @@ stats.domElement.style.top = "0px"; requestAnimFrame(update); - wabbitTexture = new PIXI.Texture("wabbit.png") + wabbitTexture = new PIXI.Texture.fromImage("wabbit.png") counter = document.createElement("div"); counter.className = "counter"; @@ -55,7 +50,6 @@ count = startBunnyCount; counter.innerHTML = count + " BUNNIES"; - container = new PIXI.DisplayObjectContainer(); stage.addChild(container); @@ -114,7 +108,9 @@ minX = 0; maxY = height; minY = 0; - + + detail.style.left = width - 204 + "px"; + detail.style.top = height - 100 + "px"; renderer.resize(width, height); } @@ -126,17 +122,17 @@ { // add 10 at a time :) - for (var i = 0; i < 2; i++) + for (var i = 0; i < 10; i++) { - var bunny = new PIXI.Sprite(wabbitTexture, {x:0, y:0, width:26, height:37}); + var bunny = new PIXI.Sprite(wabbitTexture); bunny.speedX = Math.random() * 10; bunny.speedY = (Math.random() * 10) - 5; bunny.anchor.x = 0.5; bunny.anchor.y = 1; - bunny.alpha = 0.3 + Math.random() * 0.7; + //bunny.alpha = 0.3 + Math.random() * 0.7; bunnys.push(bunny); - bunny.rotation = Math.random() - 0.5; + //bunny.rotation = Math.random() - 0.5; container.addChild(bunny); count++; diff --git a/examples/bunny benchmark/js/pixi.js b/examples/bunny benchmark/js/pixi.js new file mode 100644 index 0000000..65add09 --- /dev/null +++ b/examples/bunny benchmark/js/pixi.js @@ -0,0 +1,110 @@ +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, +d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* +j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= +a[0]-d[0],c=a[1]-d[1];a=a[2]-d[2];d=Math.sqrt(b*b+c*c+a*a);if(!d)return j[0]=0,j[1]=0,j[2]=0,j;d=1/d;j[0]=b*d;j[1]=c*d;j[2]=a*d;return j},lerp:function(a,d,j,b){b||(b=a);b[0]=a[0]+j*(d[0]-a[0]);b[1]=a[1]+j*(d[1]-a[1]);b[2]=a[2]+j*(d[2]-a[2]);return b},dist:function(a,d){var j=d[0]-a[0],b=d[1]-a[1],c=d[2]-a[2];return Math.sqrt(j*j+b*b+c*c)}},p=null,q=new k(4);l.unproject=function(a,d,j,b,c){c||(c=a);p||(p=t.create());var e=p;q[0]=2*(a[0]-b[0])/b[2]-1;q[1]=2*(a[1]-b[1])/b[3]-1;q[2]=2*a[2]-1;q[3]=1; +t.multiply(j,d,e);if(!t.inverse(e))return null;t.multiplyVec4(e,q);if(0===q[3])return null;c[0]=q[0]/q[3];c[1]=q[1]/q[3];c[2]=q[2]/q[3];return c};var C=l.createFrom(1,0,0),F=l.createFrom(0,1,0),u=l.createFrom(0,0,1),w=l.create();l.rotationTo=function(a,d,j){j||(j=m.create());var b=l.dot(a,d);if(1<=b)m.set(H,j);else if(-0.999999>b)l.cross(C,a,w),1E-6>l.length(w)&&l.cross(F,a,w),1E-6>l.length(w)&&l.cross(u,a,w),l.normalize(w),m.fromAngleAxis(Math.PI,w,j);else{var b=Math.sqrt(2*(1+b)),c=1/b;l.cross(a, +d,w);j[0]=w[0]*c;j[1]=w[1]*c;j[2]=w[2]*c;j[3]=0.5*b;m.normalize(j)}1j[3]&&(j[3]=-1);return j};l.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var x={create:function(a){var d=new k(9);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8]):d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=0;return d},createFrom:function(a,d,j,b,c,e,n,f,E){var s=new k(9);s[0]=a;s[1]=d;s[2]=j;s[3]=b;s[4]=c;s[5]=e;s[6]=n;s[7]=f;s[8]=E;return s},determinant:function(a){var d= +a[3],j=a[4],b=a[5],c=a[6],e=a[7],n=a[8];return a[0]*(n*j-b*e)+a[1]*(-n*d+b*c)+a[2]*(e*d-j*c)},inverse:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[3],n=a[4],f=a[5],E=a[6],s=a[7],I=a[8],g=I*n-f*s,h=-I*e+f*E,k=s*e-n*E,r=j*g+b*h+c*k;if(!r)return null;r=1/r;d||(d=x.create());d[0]=g*r;d[1]=(-I*b+c*s)*r;d[2]=(f*b-c*n)*r;d[3]=h*r;d[4]=(I*j-c*E)*r;d[5]=(-f*j+c*e)*r;d[6]=k*r;d[7]=(-s*j+b*E)*r;d[8]=(n*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],D=a[4],E=a[5],s=a[6],I= +a[7];a=a[8];var g=d[0],h=d[1],k=d[2],r=d[3],m=d[4],l=d[5],q=d[6],v=d[7];d=d[8];j[0]=g*b+h*f+k*s;j[1]=g*c+h*D+k*I;j[2]=g*e+h*E+k*a;j[3]=r*b+m*f+l*s;j[4]=r*c+m*D+l*I;j[5]=r*e+m*E+l*a;j[6]=q*b+v*f+d*s;j[7]=q*c+v*D+d*I;j[8]=q*e+v*E+d*a;return j},multiplyVec2:function(a,d,j){j||(j=d);var b=d[0];d=d[1];j[0]=b*a[0]+d*a[3]+a[6];j[1]=b*a[1]+d*a[4]+a[7];return j},multiplyVec3:function(a,d,j){j||(j=d);var b=d[0],c=d[1];d=d[2];j[0]=b*a[0]+c*a[3]+d*a[6];j[1]=b*a[1]+c*a[4]+d*a[7];j[2]=b*a[2]+c*a[5]+d*a[8];return j}, +set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])},identity:function(a){a||(a=x.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, +d){if(!d||a===d){var j=a[1],b=a[2],c=a[5];a[1]=a[3];a[2]=a[6];a[3]=j;a[5]=a[7];a[6]=b;a[7]=c;return a}d[0]=a[0];d[1]=a[3];d[2]=a[6];d[3]=a[1];d[4]=a[4];d[5]=a[7];d[6]=a[2];d[7]=a[5];d[8]=a[8];return d},toMat4:function(a,d){d||(d=t.create());d[15]=1;d[14]=0;d[13]=0;d[12]=0;d[11]=0;d[10]=a[8];d[9]=a[7];d[8]=a[6];d[7]=0;d[6]=a[5];d[5]=a[4];d[4]=a[3];d[3]=0;d[2]=a[2];d[1]=a[1];d[0]=a[0];return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ +a[8]+"]"}},t={create:function(a){var d=new k(16);a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8],d[9]=a[9],d[10]=a[10],d[11]=a[11],d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d},createFrom:function(a,d,j,b,c,e,f,D,E,s,g,h,m,l,r,q){var A=new k(16);A[0]=a;A[1]=d;A[2]=j;A[3]=b;A[4]=c;A[5]=e;A[6]=f;A[7]=D;A[8]=E;A[9]=s;A[10]=g;A[11]=h;A[12]=m;A[13]=l;A[14]=r;A[15]=q;return A},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4]; +d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=a[12];d[13]=a[13];d[14]=a[14];d[15]=a[15];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])&&1E-6>Math.abs(a[9]-d[9])&&1E-6>Math.abs(a[10]-d[10])&&1E-6>Math.abs(a[11]-d[11])&&1E-6>Math.abs(a[12]- +d[12])&&1E-6>Math.abs(a[13]-d[13])&&1E-6>Math.abs(a[14]-d[14])&&1E-6>Math.abs(a[15]-d[15])},identity:function(a){a||(a=t.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,d){if(!d||a===d){var j=a[1],b=a[2],c=a[3],e=a[6],f=a[7],D=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=j;a[6]=a[9];a[7]=a[13];a[8]=b;a[9]=e;a[11]=a[14];a[12]=c;a[13]=f;a[14]=D;return a}d[0]=a[0];d[1]=a[4];d[2]=a[8];d[3]=a[12]; +d[4]=a[1];d[5]=a[5];d[6]=a[9];d[7]=a[13];d[8]=a[2];d[9]=a[6];d[10]=a[10];d[11]=a[14];d[12]=a[3];d[13]=a[7];d[14]=a[11];d[15]=a[15];return d},determinant:function(a){var d=a[0],j=a[1],b=a[2],c=a[3],e=a[4],f=a[5],D=a[6],E=a[7],s=a[8],g=a[9],h=a[10],k=a[11],m=a[12],r=a[13],l=a[14];a=a[15];return m*g*D*c-s*r*D*c-m*f*h*c+e*r*h*c+s*f*l*c-e*g*l*c-m*g*b*E+s*r*b*E+m*j*h*E-d*r*h*E-s*j*l*E+d*g*l*E+m*f*b*k-e*r*b*k-m*j*D*k+d*r*D*k+e*j*l*k-d*f*l*k-s*f*b*a+e*g*b*a+s*j*D*a-d*g*D*a-e*j*h*a+d*f*h*a},inverse:function(a, +d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=a[3],f=a[4],D=a[5],E=a[6],s=a[7],g=a[8],h=a[9],k=a[10],m=a[11],r=a[12],l=a[13],A=a[14],q=a[15],v=j*D-b*f,J=j*E-c*f,y=j*s-e*f,z=b*E-c*D,t=b*s-e*D,u=c*s-e*E,p=g*l-h*r,w=g*A-k*r,x=g*q-m*r,B=h*A-k*l,C=h*q-m*l,F=k*q-m*A,G=v*F-J*C+y*B+z*x-t*w+u*p;if(!G)return null;G=1/G;d[0]=(D*F-E*C+s*B)*G;d[1]=(-b*F+c*C-e*B)*G;d[2]=(l*u-A*t+q*z)*G;d[3]=(-h*u+k*t-m*z)*G;d[4]=(-f*F+E*x-s*w)*G;d[5]=(j*F-c*x+e*w)*G;d[6]=(-r*u+A*y-q*J)*G;d[7]=(g*u-k*y+m*J)*G;d[8]=(f*C-D*x+s*p)*G;d[9]= +(-j*C+b*x-e*p)*G;d[10]=(r*t-l*y+q*v)*G;d[11]=(-g*t+h*y-m*v)*G;d[12]=(-f*B+D*w-E*p)*G;d[13]=(j*B-b*w+c*p)*G;d[14]=(-r*z+l*J-A*v)*G;d[15]=(g*z-h*J+k*v)*G;return d},toRotationMat:function(a,d){d||(d=t.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d},toMat3:function(a,d){d||(d=x.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[4];d[4]=a[5];d[5]=a[6];d[6]=a[8];d[7]=a[9];d[8]=a[10]; +return d},toInverseMat3:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[4],f=a[5],D=a[6],g=a[8],s=a[9],h=a[10],k=h*f-D*s,m=-h*e+D*g,l=s*e-f*g,r=j*k+b*m+c*l;if(!r)return null;r=1/r;d||(d=x.create());d[0]=k*r;d[1]=(-h*b+c*s)*r;d[2]=(D*b-c*f)*r;d[3]=m*r;d[4]=(h*j-c*g)*r;d[5]=(-D*j+c*e)*r;d[6]=l*r;d[7]=(-s*j+b*g)*r;d[8]=(f*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],s=a[6],k=a[7],m=a[8],l=a[9],q=a[10],r=a[11],t=a[12],A=a[13],u=a[14];a=a[15];var v=d[0], +p=d[1],y=d[2],z=d[3];j[0]=v*b+p*g+y*m+z*t;j[1]=v*c+p*h+y*l+z*A;j[2]=v*e+p*s+y*q+z*u;j[3]=v*f+p*k+y*r+z*a;v=d[4];p=d[5];y=d[6];z=d[7];j[4]=v*b+p*g+y*m+z*t;j[5]=v*c+p*h+y*l+z*A;j[6]=v*e+p*s+y*q+z*u;j[7]=v*f+p*k+y*r+z*a;v=d[8];p=d[9];y=d[10];z=d[11];j[8]=v*b+p*g+y*m+z*t;j[9]=v*c+p*h+y*l+z*A;j[10]=v*e+p*s+y*q+z*u;j[11]=v*f+p*k+y*r+z*a;v=d[12];p=d[13];y=d[14];z=d[15];j[12]=v*b+p*g+y*m+z*t;j[13]=v*c+p*h+y*l+z*A;j[14]=v*e+p*s+y*q+z*u;j[15]=v*f+p*k+y*r+z*a;return j},multiplyVec3:function(a,d,b){b||(b=d); +var c=d[0],e=d[1];d=d[2];b[0]=a[0]*c+a[4]*e+a[8]*d+a[12];b[1]=a[1]*c+a[5]*e+a[9]*d+a[13];b[2]=a[2]*c+a[6]*e+a[10]*d+a[14];return b},multiplyVec4:function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=d[3];b[0]=a[0]*c+a[4]*e+a[8]*f+a[12]*d;b[1]=a[1]*c+a[5]*e+a[9]*f+a[13]*d;b[2]=a[2]*c+a[6]*e+a[10]*f+a[14]*d;b[3]=a[3]*c+a[7]*e+a[11]*f+a[15]*d;return b},translate:function(a,d,b){var c=d[0],e=d[1];d=d[2];var f,n,g,h,s,k,m,l,p,r,q,t;if(!b||a===b)return a[12]=a[0]*c+a[4]*e+a[8]*d+a[12],a[13]=a[1]*c+a[5]*e+ +a[9]*d+a[13],a[14]=a[2]*c+a[6]*e+a[10]*d+a[14],a[15]=a[3]*c+a[7]*e+a[11]*d+a[15],a;f=a[0];n=a[1];g=a[2];h=a[3];s=a[4];k=a[5];m=a[6];l=a[7];p=a[8];r=a[9];q=a[10];t=a[11];b[0]=f;b[1]=n;b[2]=g;b[3]=h;b[4]=s;b[5]=k;b[6]=m;b[7]=l;b[8]=p;b[9]=r;b[10]=q;b[11]=t;b[12]=f*c+s*e+p*d+a[12];b[13]=n*c+k*e+r*d+a[13];b[14]=g*c+m*e+q*d+a[14];b[15]=h*c+l*e+t*d+a[15];return b},scale:function(a,d,b){var c=d[0],e=d[1];d=d[2];if(!b||a===b)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=d,a[9]*= +d,a[10]*=d,a[11]*=d,a;b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[7]=a[7]*e;b[8]=a[8]*d;b[9]=a[9]*d;b[10]=a[10]*d;b[11]=a[11]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},rotate:function(a,d,b,c){var e=b[0],f=b[1];b=b[2];var n=Math.sqrt(e*e+f*f+b*b),g,h,k,m,l,p,q,r,t,u,w,v,x,y,z,B,C,F,H,K;if(!n)return null;1!==n&&(n=1/n,e*=n,f*=n,b*=n);g=Math.sin(d);h=Math.cos(d);k=1-h;d=a[0];n=a[1];m=a[2];l=a[3];p=a[4];q=a[5];r=a[6];t=a[7];u=a[8];w=a[9];v= +a[10];x=a[11];y=e*e*k+h;z=f*e*k+b*g;B=b*e*k-f*g;C=e*f*k-b*g;F=f*f*k+h;H=b*f*k+e*g;K=e*b*k+f*g;e=f*b*k-e*g;f=b*b*k+h;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=d*y+p*z+u*B;c[1]=n*y+q*z+w*B;c[2]=m*y+r*z+v*B;c[3]=l*y+t*z+x*B;c[4]=d*C+p*F+u*H;c[5]=n*C+q*F+w*H;c[6]=m*C+r*F+v*H;c[7]=l*C+t*F+x*H;c[8]=d*K+p*e+u*f;c[9]=n*K+q*e+w*f;c[10]=m*K+r*e+v*f;c[11]=l*K+t*e+x*f;return c},rotateX:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[4],f=a[5],n=a[6],g=a[7],h=a[8],k=a[9],m=a[10], +l=a[11];b?a!==b&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[4]=e*d+h*c;b[5]=f*d+k*c;b[6]=n*d+m*c;b[7]=g*d+l*c;b[8]=e*-c+h*d;b[9]=f*-c+k*d;b[10]=n*-c+m*d;b[11]=g*-c+l*d;return b},rotateY:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[8],k=a[9],m=a[10],l=a[11];b?a!==b&&(b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*-c;b[1]=f*d+k*-c;b[2]=n*d+m*-c;b[3]=g* +d+l*-c;b[8]=e*c+h*d;b[9]=f*c+k*d;b[10]=n*c+m*d;b[11]=g*c+l*d;return b},rotateZ:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[4],k=a[5],m=a[6],l=a[7];b?a!==b&&(b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*c;b[1]=f*d+k*c;b[2]=n*d+m*c;b[3]=g*d+l*c;b[4]=e*-c+h*d;b[5]=f*-c+k*d;b[6]=n*-c+m*d;b[7]=g*-c+l*d;return b},frustum:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2*e/g;n[1]=0; +n[2]=0;n[3]=0;n[4]=0;n[5]=2*e/h;n[6]=0;n[7]=0;n[8]=(d+a)/g;n[9]=(c+b)/h;n[10]=-(f+e)/k;n[11]=-1;n[12]=0;n[13]=0;n[14]=-(2*f*e)/k;n[15]=0;return n},perspective:function(a,d,b,c,e){a=b*Math.tan(a*Math.PI/360);d*=a;return t.frustum(-d,d,-a,a,b,c,e)},ortho:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2/g;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=2/h;n[6]=0;n[7]=0;n[8]=0;n[9]=0;n[10]=-2/k;n[11]=0;n[12]=-(a+d)/g;n[13]=-(c+b)/h;n[14]=-(f+e)/k;n[15]=1;return n},lookAt:function(a,d,b,c){c|| +(c=t.create());var e,f,n,g,h,k,m,l,p=a[0],q=a[1];a=a[2];n=b[0];g=b[1];f=b[2];m=d[0];b=d[1];e=d[2];if(p===m&&q===b&&a===e)return t.identity(c);d=p-m;b=q-b;m=a-e;l=1/Math.sqrt(d*d+b*b+m*m);d*=l;b*=l;m*=l;e=g*m-f*b;f=f*d-n*m;n=n*b-g*d;(l=Math.sqrt(e*e+f*f+n*n))?(l=1/l,e*=l,f*=l,n*=l):n=f=e=0;g=b*n-m*f;h=m*e-d*n;k=d*f-b*e;(l=Math.sqrt(g*g+h*h+k*k))?(l=1/l,g*=l,h*=l,k*=l):k=h=g=0;c[0]=e;c[1]=g;c[2]=d;c[3]=0;c[4]=f;c[5]=h;c[6]=b;c[7]=0;c[8]=n;c[9]=k;c[10]=m;c[11]=0;c[12]=-(e*p+f*q+n*a);c[13]=-(g*p+h*q+ +k*a);c[14]=-(d*p+b*q+m*a);c[15]=1;return c},fromRotationTranslation:function(a,d,b){b||(b=t.create());var c=a[0],e=a[1],f=a[2],n=a[3],g=c+c,h=e+e,k=f+f;a=c*g;var l=c*h,c=c*k,m=e*h,e=e*k,f=f*k,g=n*g,h=n*h,n=n*k;b[0]=1-(m+f);b[1]=l+n;b[2]=c-h;b[3]=0;b[4]=l-n;b[5]=1-(a+f);b[6]=e+g;b[7]=0;b[8]=c+h;b[9]=e-g;b[10]=1-(a+m);b[11]=0;b[12]=d[0];b[13]=d[1];b[14]=d[2];b[15]=1;return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ +a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},m={create:function(a){var d=new k(4);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]):d[0]=d[1]=d[2]=d[3]=0;return d},createFrom:function(a,d,b,c){var e=new k(4);e[0]=a;e[1]=d;e[2]=b;e[3]=c;return e},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])},identity:function(a){a||(a=m.create()); +a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},H=m.identity();m.calculateW=function(a,d){var b=a[0],c=a[1],e=a[2];if(!d||a===d)return a[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e)),a;d[0]=b;d[1]=c;d[2]=e;d[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e));return d};m.dot=function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3]};m.inverse=function(a,d){var b=a[0],c=a[1],e=a[2],f=a[3],b=(b=b*b+c*c+e*e+f*f)?1/b:0;if(!d||a===d)return a[0]*=-b,a[1]*=-b,a[2]*=-b,a[3]*=b,a;d[0]=-a[0]*b;d[1]=-a[1]*b;d[2]=-a[2]*b;d[3]=a[3]*b; +return d};m.conjugate=function(a,d){if(!d||a===d)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=a[3];return d};m.length=function(a){var d=a[0],b=a[1],c=a[2];a=a[3];return Math.sqrt(d*d+b*b+c*c+a*a)};m.normalize=function(a,d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=Math.sqrt(b*b+c*c+e*e+f*f);if(0===g)return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d;g=1/g;d[0]=b*g;d[1]=c*g;d[2]=e*g;d[3]=f*g;return d};m.add=function(a,d,b){if(!b||a===b)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a[3]+= +d[3],a;b[0]=a[0]+d[0];b[1]=a[1]+d[1];b[2]=a[2]+d[2];b[3]=a[3]+d[3];return b};m.multiply=function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2];a=a[3];var g=d[0],h=d[1],k=d[2];d=d[3];b[0]=c*d+a*g+e*k-f*h;b[1]=e*d+a*h+f*g-c*k;b[2]=f*d+a*k+c*h-e*g;b[3]=a*d-c*g-e*h-f*k;return b};m.multiplyVec3=function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=a[0];var g=a[1],h=a[2];a=a[3];var k=a*c+g*f-h*e,l=a*e+h*c-d*f,m=a*f+d*e-g*c,c=-d*c-g*e-h*f;b[0]=k*a+c*-d+l*-h-m*-g;b[1]=l*a+c*-g+m*-d-k*-h;b[2]=m*a+c*-h+k*-g-l*-d; +return b};m.scale=function(a,d,b){if(!b||a===b)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a;b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[3]=a[3]*d;return b};m.toMat3=function(a,d){d||(d=x.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b*k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=m-f;d[4]=1-(l+e);d[5]=c+g;d[6]=b+h;d[7]=c-g;d[8]=1-(l+p);return d};m.toMat4=function(a,d){d||(d=t.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b* +k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=0;d[4]=m-f;d[5]=1-(l+e);d[6]=c+g;d[7]=0;d[8]=b+h;d[9]=c-g;d[10]=1-(l+p);d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d};m.slerp=function(a,d,b,c){c||(c=a);var e=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3],f,g;if(1<=Math.abs(e))return c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]),c;f=Math.acos(e);g=Math.sqrt(1-e*e);if(0.0010>Math.abs(g))return c[0]=0.5*a[0]+0.5*d[0],c[1]=0.5*a[1]+0.5*d[1],c[2]=0.5*a[2]+0.5*d[2],c[3]=0.5*a[3]+ +0.5*d[3],c;e=Math.sin((1-b)*f)/g;b=Math.sin(b*f)/g;c[0]=a[0]*e+d[0]*b;c[1]=a[1]*e+d[1]*b;c[2]=a[2]*e+d[2]*b;c[3]=a[3]*e+d[3]*b;return c};m.fromRotationMatrix=function(a,d){d||(d=m.create());var b=a[0]+a[4]+a[8],c;if(0a[0]&&(b=1);a[8]>a[3*b+b]&&(b=2);var e=c[b],f=c[e];c=Math.sqrt(a[3*b+b]-a[3*e+e]-a[3*f+f]+1);d[b]=0.5*c;c= +0.5/c;d[3]=(a[3*f+e]-a[3*e+f])*c;d[e]=(a[3*e+b]+a[3*b+e])*c;d[f]=(a[3*f+b]+a[3*b+f])*c}return d};x.toQuat4=m.fromRotationMatrix;var B=x.create();m.fromAxes=function(a,d,b,c){B[0]=d[0];B[3]=d[1];B[6]=d[2];B[1]=b[0];B[4]=b[1];B[7]=b[2];B[2]=a[0];B[5]=a[1];B[8]=a[2];return m.fromRotationMatrix(B,c)};m.identity=function(a){a||(a=m.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};m.fromAngleAxis=function(a,d,b){b||(b=m.create());a*=0.5;var c=Math.sin(a);b[3]=Math.cos(a);b[0]=c*d[0];b[1]=c*d[1];b[2]=c*d[2]; +return b};m.toAngleAxis=function(a,d){d||(d=a);var b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); +b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 +Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],e=a[1],f=a[2],g=a[3],h=c*g-f*e;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-e*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, +b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];c[0]=e*b[0]+f*b[2];c[1]=e*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=e*b+f*h;c[1]=e*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var e=b[0];b=b[1];c[0]=e*a[0]+b*a[1];c[1]=e*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var e=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=e*b;c[2]=f*h;c[3]= +g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, +b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| +(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= +f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; +PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; +PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l>1);var b=m[0];return b*(1.5-0.5*a*b*b)}}else g.invsqrt=function(a){return 1/Math.sqrt(a)}; -var l=null;f();var j={create:function(a){var b=new l(3);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0;return b},createFrom:function(a,b,e){var c=new l(3);c[0]=a;c[1]=b;c[2]=e;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])},add:function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];return e},subtract:function(a, -b,e){if(!e||a===e)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];return e},multiply:function(a,b,e){if(!e||a===e)return a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a;e[0]=a[0]*b[0];e[1]=a[1]*b[1];e[2]=a[2]*b[2];return e},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;return e},normalize:function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=Math.sqrt(e* -e+c*c+d*d);if(!k)return b[0]=0,b[1]=0,b[2]=0,b;if(1===k)return b[0]=e,b[1]=c,b[2]=d,b;k=1/k;b[0]=e*k;b[1]=c*k;b[2]=d*k;return b},cross:function(a,b,e){e||(e=a);var c=a[0],d=a[1];a=a[2];var k=b[0],h=b[1];b=b[2];e[0]=d*b-a*h;e[1]=a*k-c*b;e[2]=c*h-d*k;return e},length:function(a){var b=a[0],e=a[1];a=a[2];return Math.sqrt(b*b+e*e+a*a)},squaredLength:function(a){var b=a[0],e=a[1];a=a[2];return b*b+e*e+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,b,e){e||(e=a);var c= -a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];b=Math.sqrt(c*c+d*d+a*a);if(!b)return e[0]=0,e[1]=0,e[2]=0,e;b=1/b;e[0]=c*b;e[1]=d*b;e[2]=a*b;return e},lerp:function(a,b,e,c){c||(c=a);c[0]=a[0]+e*(b[0]-a[0]);c[1]=a[1]+e*(b[1]-a[1]);c[2]=a[2]+e*(b[2]-a[2]);return c},dist:function(a,b){var e=b[0]-a[0],c=b[1]-a[1],d=b[2]-a[2];return Math.sqrt(e*e+c*c+d*d)}},x=null,n=new l(4);j.unproject=function(a,b,e,c,d){d||(d=a);x||(x=y.create());var k=x;n[0]=2*(a[0]-c[0])/c[2]-1;n[1]=2*(a[1]-c[1])/c[3]-1;n[2]=2*a[2]-1;n[3]=1; -y.multiply(e,b,k);if(!y.inverse(k))return null;y.multiplyVec4(k,n);if(0===n[3])return null;d[0]=n[0]/n[3];d[1]=n[1]/n[3];d[2]=n[2]/n[3];return d};var z=j.createFrom(1,0,0),A=j.createFrom(0,1,0),H=j.createFrom(0,0,1),C=j.create();j.rotationTo=function(a,b,e){e||(e=s.create());var c=j.dot(a,b);if(1<=c)s.set(O,e);else if(-0.999999>c)j.cross(z,a,C),1E-6>j.length(C)&&j.cross(A,a,C),1E-6>j.length(C)&&j.cross(H,a,C),j.normalize(C),s.fromAngleAxis(Math.PI,C,e);else{var c=Math.sqrt(2*(1+c)),d=1/c;j.cross(a, -b,C);e[0]=C[0]*d;e[1]=C[1]*d;e[2]=C[2]*d;e[3]=0.5*c;s.normalize(e)}1e[3]&&(e[3]=-1);return e};j.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var F={create:function(a){var b=new l(9);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0;return b},createFrom:function(a,b,e,c,d,k,h,E,K){var q=new l(9);q[0]=a;q[1]=b;q[2]=e;q[3]=c;q[4]=d;q[5]=k;q[6]=h;q[7]=E;q[8]=K;return q},determinant:function(a){var b= -a[3],e=a[4],c=a[5],d=a[6],k=a[7],h=a[8];return a[0]*(h*e-c*k)+a[1]*(-h*b+c*d)+a[2]*(k*b-e*d)},inverse:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],E=a[5],K=a[6],q=a[7],f=a[8],g=f*h-E*q,j=-f*k+E*K,J=q*k-h*K,r=e*g+c*j+d*J;if(!r)return null;r=1/r;b||(b=F.create());b[0]=g*r;b[1]=(-f*c+d*q)*r;b[2]=(E*c-d*h)*r;b[3]=j*r;b[4]=(f*e-d*K)*r;b[5]=(-E*e+d*k)*r;b[6]=J*r;b[7]=(-q*e+c*K)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],E=a[4],f=a[5],q=a[6],g= -a[7];a=a[8];var u=b[0],j=b[1],J=b[2],r=b[3],l=b[4],t=b[5],m=b[6],p=b[7];b=b[8];e[0]=u*c+j*h+J*q;e[1]=u*d+j*E+J*g;e[2]=u*k+j*f+J*a;e[3]=r*c+l*h+t*q;e[4]=r*d+l*E+t*g;e[5]=r*k+l*f+t*a;e[6]=m*c+p*h+b*q;e[7]=m*d+p*E+b*g;e[8]=m*k+p*f+b*a;return e},multiplyVec2:function(a,b,e){e||(e=b);var c=b[0];b=b[1];e[0]=c*a[0]+b*a[3]+a[6];e[1]=c*a[1]+b*a[4]+a[7];return e},multiplyVec3:function(a,b,e){e||(e=b);var c=b[0],d=b[1];b=b[2];e[0]=c*a[0]+d*a[3]+b*a[6];e[1]=c*a[1]+d*a[4]+b*a[7];e[2]=c*a[2]+d*a[5]+b*a[8];return e}, -set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])},identity:function(a){a||(a=F.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, -b){if(!b||a===b){var e=a[1],c=a[2],d=a[5];a[1]=a[3];a[2]=a[6];a[3]=e;a[5]=a[7];a[6]=c;a[7]=d;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]=a[8];return b},toMat4:function(a,b){b||(b=y.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ -a[8]+"]"}},y={create:function(a){var b=new l(16);a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]);return b},createFrom:function(a,b,e,c,d,k,h,E,f,q,g,u,j,J,r,m){var t=new l(16);t[0]=a;t[1]=b;t[2]=e;t[3]=c;t[4]=d;t[5]=k;t[6]=h;t[7]=E;t[8]=f;t[9]=q;t[10]=g;t[11]=u;t[12]=j;t[13]=J;t[14]=r;t[15]=m;return t},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4]; -b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])&&1E-6>Math.abs(a[9]-b[9])&&1E-6>Math.abs(a[10]-b[10])&&1E-6>Math.abs(a[11]-b[11])&&1E-6>Math.abs(a[12]- -b[12])&&1E-6>Math.abs(a[13]-b[13])&&1E-6>Math.abs(a[14]-b[14])&&1E-6>Math.abs(a[15]-b[15])},identity:function(a){a||(a=y.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){var e=a[1],c=a[2],d=a[3],k=a[6],h=a[7],E=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=e;a[6]=a[9];a[7]=a[13];a[8]=c;a[9]=k;a[11]=a[14];a[12]=d;a[13]=h;a[14]=E;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12]; -b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b=a[0],e=a[1],c=a[2],d=a[3],k=a[4],h=a[5],E=a[6],f=a[7],g=a[8],I=a[9],u=a[10],j=a[11],l=a[12],r=a[13],m=a[14];a=a[15];return l*I*E*d-g*r*E*d-l*h*u*d+k*r*u*d+g*h*m*d-k*I*m*d-l*I*c*f+g*r*c*f+l*e*u*f-b*r*u*f-g*e*m*f+b*I*m*f+l*h*c*j-k*r*c*j-l*e*E*j+b*r*E*j+k*e*m*j-b*h*m*j-g*h*c*a+k*I*c*a+g*e*E*a-b*I*E*a-k*e*u*a+b*h*u*a},inverse:function(a, -b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],f=a[5],g=a[6],q=a[7],I=a[8],u=a[9],j=a[10],l=a[11],r=a[12],m=a[13],t=a[14],p=a[15],s=e*f-c*h,n=e*g-d*h,v=e*q-k*h,w=c*g-d*f,x=c*q-k*f,y=d*q-k*g,z=I*m-u*r,A=I*t-j*r,C=I*p-l*r,D=u*t-j*m,F=u*p-l*m,H=j*p-l*t,G=s*H-n*F+v*D+w*C-x*A+y*z;if(!G)return null;G=1/G;b[0]=(f*H-g*F+q*D)*G;b[1]=(-c*H+d*F-k*D)*G;b[2]=(m*y-t*x+p*w)*G;b[3]=(-u*y+j*x-l*w)*G;b[4]=(-h*H+g*C-q*A)*G;b[5]=(e*H-d*C+k*A)*G;b[6]=(-r*y+t*v-p*n)*G;b[7]=(I*y-j*v+l*n)*G;b[8]=(h*F-f*C+q*z)*G;b[9]= -(-e*F+c*C-k*z)*G;b[10]=(r*x-m*v+p*s)*G;b[11]=(-I*x+u*v-l*s)*G;b[12]=(-h*D+f*A-g*z)*G;b[13]=(e*D-c*A+d*z)*G;b[14]=(-r*w+m*n-t*s)*G;b[15]=(I*w-u*n+j*s)*G;return b},toRotationMat:function(a,b){b||(b=y.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=F.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10]; -return b},toInverseMat3:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[4],h=a[5],f=a[6],g=a[8],q=a[9],j=a[10],u=j*h-f*q,l=-j*k+f*g,m=q*k-h*g,r=e*u+c*l+d*m;if(!r)return null;r=1/r;b||(b=F.create());b[0]=u*r;b[1]=(-j*c+d*q)*r;b[2]=(f*c-d*h)*r;b[3]=l*r;b[4]=(j*e-d*g)*r;b[5]=(-f*e+d*k)*r;b[6]=m*r;b[7]=(-q*e+c*g)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],f=a[4],g=a[5],q=a[6],j=a[7],u=a[8],l=a[9],m=a[10],r=a[11],p=a[12],t=a[13],s=a[14];a=a[15];var n=b[0], -B=b[1],v=b[2],w=b[3];e[0]=n*c+B*f+v*u+w*p;e[1]=n*d+B*g+v*l+w*t;e[2]=n*k+B*q+v*m+w*s;e[3]=n*h+B*j+v*r+w*a;n=b[4];B=b[5];v=b[6];w=b[7];e[4]=n*c+B*f+v*u+w*p;e[5]=n*d+B*g+v*l+w*t;e[6]=n*k+B*q+v*m+w*s;e[7]=n*h+B*j+v*r+w*a;n=b[8];B=b[9];v=b[10];w=b[11];e[8]=n*c+B*f+v*u+w*p;e[9]=n*d+B*g+v*l+w*t;e[10]=n*k+B*q+v*m+w*s;e[11]=n*h+B*j+v*r+w*a;n=b[12];B=b[13];v=b[14];w=b[15];e[12]=n*c+B*f+v*u+w*p;e[13]=n*d+B*g+v*l+w*t;e[14]=n*k+B*q+v*m+w*s;e[15]=n*h+B*j+v*r+w*a;return e},multiplyVec3:function(a,b,e){e||(e=b); -var c=b[0],d=b[1];b=b[2];e[0]=a[0]*c+a[4]*d+a[8]*b+a[12];e[1]=a[1]*c+a[5]*d+a[9]*b+a[13];e[2]=a[2]*c+a[6]*d+a[10]*b+a[14];return e},multiplyVec4:function(a,b,e){e||(e=b);var c=b[0],d=b[1],k=b[2];b=b[3];e[0]=a[0]*c+a[4]*d+a[8]*k+a[12]*b;e[1]=a[1]*c+a[5]*d+a[9]*k+a[13]*b;e[2]=a[2]*c+a[6]*d+a[10]*k+a[14]*b;e[3]=a[3]*c+a[7]*d+a[11]*k+a[15]*b;return e},translate:function(a,b,e){var c=b[0],d=b[1];b=b[2];var k,h,f,g,q,j,u,l,m,n,p,s;if(!e||a===e)return a[12]=a[0]*c+a[4]*d+a[8]*b+a[12],a[13]=a[1]*c+a[5]*d+ -a[9]*b+a[13],a[14]=a[2]*c+a[6]*d+a[10]*b+a[14],a[15]=a[3]*c+a[7]*d+a[11]*b+a[15],a;k=a[0];h=a[1];f=a[2];g=a[3];q=a[4];j=a[5];u=a[6];l=a[7];m=a[8];n=a[9];p=a[10];s=a[11];e[0]=k;e[1]=h;e[2]=f;e[3]=g;e[4]=q;e[5]=j;e[6]=u;e[7]=l;e[8]=m;e[9]=n;e[10]=p;e[11]=s;e[12]=k*c+q*d+m*b+a[12];e[13]=h*c+j*d+n*b+a[13];e[14]=f*c+u*d+p*b+a[14];e[15]=g*c+l*d+s*b+a[15];return e},scale:function(a,b,e){var c=b[0],d=b[1];b=b[2];if(!e||a===e)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=d,a[5]*=d,a[6]*=d,a[7]*=d,a[8]*=b,a[9]*= -b,a[10]*=b,a[11]*=b,a;e[0]=a[0]*c;e[1]=a[1]*c;e[2]=a[2]*c;e[3]=a[3]*c;e[4]=a[4]*d;e[5]=a[5]*d;e[6]=a[6]*d;e[7]=a[7]*d;e[8]=a[8]*b;e[9]=a[9]*b;e[10]=a[10]*b;e[11]=a[11]*b;e[12]=a[12];e[13]=a[13];e[14]=a[14];e[15]=a[15];return e},rotate:function(a,b,e,c){var d=e[0],k=e[1];e=e[2];var h=Math.sqrt(d*d+k*k+e*e),f,g,q,j,l,m,n,r,p,s,x,y,B,v,w,z,A,C,D,F;if(!h)return null;1!==h&&(h=1/h,d*=h,k*=h,e*=h);f=Math.sin(b);g=Math.cos(b);q=1-g;b=a[0];h=a[1];j=a[2];l=a[3];m=a[4];n=a[5];r=a[6];p=a[7];s=a[8];x=a[9];y= -a[10];B=a[11];v=d*d*q+g;w=k*d*q+e*f;z=e*d*q-k*f;A=d*k*q-e*f;C=k*k*q+g;D=e*k*q+d*f;F=d*e*q+k*f;d=k*e*q-d*f;k=e*e*q+g;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=b*v+m*w+s*z;c[1]=h*v+n*w+x*z;c[2]=j*v+r*w+y*z;c[3]=l*v+p*w+B*z;c[4]=b*A+m*C+s*D;c[5]=h*A+n*C+x*D;c[6]=j*A+r*C+y*D;c[7]=l*A+p*C+B*D;c[8]=b*F+m*d+s*k;c[9]=h*F+n*d+x*k;c[10]=j*F+r*d+y*k;c[11]=l*F+p*d+B*k;return c},rotateX:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[4],k=a[5],h=a[6],f=a[7],g=a[8],q=a[9],j=a[10], -l=a[11];e?a!==e&&(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[4]=d*b+g*c;e[5]=k*b+q*c;e[6]=h*b+j*c;e[7]=f*b+l*c;e[8]=d*-c+g*b;e[9]=k*-c+q*b;e[10]=h*-c+j*b;e[11]=f*-c+l*b;return e},rotateY:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[8],j=a[9],l=a[10],m=a[11];e?a!==e&&(e[4]=a[4],e[5]=a[5],e[6]=a[6],e[7]=a[7],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*-c;e[1]=k*b+j*-c;e[2]=h*b+l*-c;e[3]=f* -b+m*-c;e[8]=d*c+g*b;e[9]=k*c+j*b;e[10]=h*c+l*b;e[11]=f*c+m*b;return e},rotateZ:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[4],j=a[5],l=a[6],m=a[7];e?a!==e&&(e[8]=a[8],e[9]=a[9],e[10]=a[10],e[11]=a[11],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*c;e[1]=k*b+j*c;e[2]=h*b+l*c;e[3]=f*b+m*c;e[4]=d*-c+g*b;e[5]=k*-c+j*b;e[6]=h*-c+l*b;e[7]=f*-c+m*b;return e},frustum:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2*d/f;h[1]=0; -h[2]=0;h[3]=0;h[4]=0;h[5]=2*d/g;h[6]=0;h[7]=0;h[8]=(b+a)/f;h[9]=(c+e)/g;h[10]=-(k+d)/j;h[11]=-1;h[12]=0;h[13]=0;h[14]=-(2*k*d)/j;h[15]=0;return h},perspective:function(a,b,e,c,d){a=e*Math.tan(a*Math.PI/360);b*=a;return y.frustum(-b,b,-a,a,e,c,d)},ortho:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2/f;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/g;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/j;h[11]=0;h[12]=-(a+b)/f;h[13]=-(c+e)/g;h[14]=-(k+d)/j;h[15]=1;return h},lookAt:function(a,b,e,c){c|| -(c=y.create());var d,k,h,f,g,j,l,m,n=a[0],p=a[1];a=a[2];h=e[0];f=e[1];k=e[2];l=b[0];e=b[1];d=b[2];if(n===l&&p===e&&a===d)return y.identity(c);b=n-l;e=p-e;l=a-d;m=1/Math.sqrt(b*b+e*e+l*l);b*=m;e*=m;l*=m;d=f*l-k*e;k=k*b-h*l;h=h*e-f*b;(m=Math.sqrt(d*d+k*k+h*h))?(m=1/m,d*=m,k*=m,h*=m):h=k=d=0;f=e*h-l*k;g=l*d-b*h;j=b*k-e*d;(m=Math.sqrt(f*f+g*g+j*j))?(m=1/m,f*=m,g*=m,j*=m):j=g=f=0;c[0]=d;c[1]=f;c[2]=b;c[3]=0;c[4]=k;c[5]=g;c[6]=e;c[7]=0;c[8]=h;c[9]=j;c[10]=l;c[11]=0;c[12]=-(d*n+k*p+h*a);c[13]=-(f*n+g*p+ -j*a);c[14]=-(b*n+e*p+l*a);c[15]=1;return c},fromRotationTranslation:function(a,b,e){e||(e=y.create());var c=a[0],d=a[1],k=a[2],h=a[3],f=c+c,g=d+d,j=k+k;a=c*f;var l=c*g,c=c*j,m=d*g,d=d*j,k=k*j,f=h*f,g=h*g,h=h*j;e[0]=1-(m+k);e[1]=l+h;e[2]=c-g;e[3]=0;e[4]=l-h;e[5]=1-(a+k);e[6]=d+f;e[7]=0;e[8]=c+g;e[9]=d-f;e[10]=1-(a+m);e[11]=0;e[12]=b[0];e[13]=b[1];e[14]=b[2];e[15]=1;return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ -a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},s={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,e,c){var d=new l(4);d[0]=a;d[1]=b;d[2]=e;d[3]=c;return d},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=s.create()); -a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},O=s.identity();s.calculateW=function(a,b){var e=a[0],c=a[1],d=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d)),a;b[0]=e;b[1]=c;b[2]=d;b[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d));return b};s.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};s.inverse=function(a,b){var e=a[0],c=a[1],d=a[2],f=a[3],e=(e=e*e+c*c+d*d+f*f)?1/e:0;if(!b||a===b)return a[0]*=-e,a[1]*=-e,a[2]*=-e,a[3]*=e,a;b[0]=-a[0]*e;b[1]=-a[1]*e;b[2]=-a[2]*e;b[3]=a[3]*e; -return b};s.conjugate=function(a,b){if(!b||a===b)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};s.length=function(a){var b=a[0],e=a[1],c=a[2];a=a[3];return Math.sqrt(b*b+e*e+c*c+a*a)};s.normalize=function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],f=a[3],h=Math.sqrt(e*e+c*c+d*d+f*f);if(0===h)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;h=1/h;b[0]=e*h;b[1]=c*h;b[2]=d*h;b[3]=f*h;return b};s.add=function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+= -b[3],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];e[3]=a[3]+b[3];return e};s.multiply=function(a,b,e){e||(e=a);var c=a[0],d=a[1],f=a[2];a=a[3];var h=b[0],g=b[1],j=b[2];b=b[3];e[0]=c*b+a*h+d*j-f*g;e[1]=d*b+a*g+f*h-c*j;e[2]=f*b+a*j+c*g-d*h;e[3]=a*b-c*h-d*g-f*j;return e};s.multiplyVec3=function(a,b,e){e||(e=b);var c=b[0],d=b[1],f=b[2];b=a[0];var h=a[1],g=a[2];a=a[3];var j=a*c+h*f-g*d,l=a*d+g*c-b*f,m=a*f+b*d-h*c,c=-b*c-h*d-g*f;e[0]=j*a+c*-b+l*-g-m*-h;e[1]=l*a+c*-h+m*-b-j*-g;e[2]=m*a+c*-g+j*-h-l*-b; -return e};s.scale=function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a[3]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;e[3]=a[3]*b;return e};s.toMat3=function(a,b){b||(b=F.create());var e=a[0],c=a[1],d=a[2],f=a[3],h=e+e,g=c+c,j=d+d,l=e*h,m=e*g,e=e*j,n=c*g,c=c*j,d=d*j,h=f*h,g=f*g,f=f*j;b[0]=1-(n+d);b[1]=m+f;b[2]=e-g;b[3]=m-f;b[4]=1-(l+d);b[5]=c+h;b[6]=e+g;b[7]=c-h;b[8]=1-(l+n);return b};s.toMat4=function(a,b){b||(b=y.create());var e=a[0],c=a[1],d=a[2],f=a[3],g=e+e,j=c+c,l=d+d,m=e*g,n=e*j,e=e* -l,p=c*j,c=c*l,d=d*l,g=f*g,j=f*j,f=f*l;b[0]=1-(p+d);b[1]=n+f;b[2]=e-j;b[3]=0;b[4]=n-f;b[5]=1-(m+d);b[6]=c+g;b[7]=0;b[8]=e+j;b[9]=c-g;b[10]=1-(m+p);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};s.slerp=function(a,b,c,d){d||(d=a);var f=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],g,h;if(1<=Math.abs(f))return d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d;g=Math.acos(f);h=Math.sqrt(1-f*f);if(0.001>Math.abs(h))return d[0]=0.5*a[0]+0.5*b[0],d[1]=0.5*a[1]+0.5*b[1],d[2]=0.5*a[2]+0.5*b[2],d[3]=0.5*a[3]+ -0.5*b[3],d;f=Math.sin((1-c)*g)/h;c=Math.sin(c*g)/h;d[0]=a[0]*f+b[0]*c;d[1]=a[1]*f+b[1]*c;d[2]=a[2]*f+b[2]*c;d[3]=a[3]*f+b[3]*c;return d};s.fromRotationMatrix=function(a,b){b||(b=s.create());var c=a[0]+a[4]+a[8],d;if(0a[0]&&(c=1);a[8]>a[3*c+c]&&(c=2);var f=d[c],g=d[f];d=Math.sqrt(a[3*c+c]-a[3*f+f]-a[3*g+g]+1);b[c]=0.5*d;d= -0.5/d;b[3]=(a[3*g+f]-a[3*f+g])*d;b[f]=(a[3*f+c]+a[3*c+f])*d;b[g]=(a[3*g+c]+a[3*c+g])*d}return b};F.toQuat4=s.fromRotationMatrix;var D=F.create();s.fromAxes=function(a,b,c,d){D[0]=b[0];D[3]=b[1];D[6]=b[2];D[1]=c[0];D[4]=c[1];D[7]=c[2];D[2]=a[0];D[5]=a[1];D[8]=a[2];return s.fromRotationMatrix(D,d)};s.identity=function(a){a||(a=s.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};s.fromAngleAxis=function(a,b,c){c||(c=s.create());a*=0.5;var d=Math.sin(a);c[3]=Math.cos(a);c[0]=d*b[0];c[1]=d*b[1];c[2]=d*b[2]; -return c};s.toAngleAxis=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); -b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 -Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],f=a[2],g=a[3],h=c*g-f*d;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-d*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, -b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];c[0]=d*b[0]+f*b[2];c[1]=d*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=d*b+f*h;c[1]=d*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var d=b[0];b=b[1];c[0]=d*a[0]+b*a[1];c[1]=d*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var d=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=d*b;c[2]=f*h;c[3]= -g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,d){var f=new l(4);f[0]=a;f[1]=b;f[2]=c;f[3]=d;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, -b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| -(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)},squaredLength:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};c&&(c.glMatrixArrayType=l,c.MatrixArray=l,c.setMatrixArrayType=d,c.determineMatrixArrayType= -f,c.glMath=g,c.vec2=M,c.vec3=j,c.vec4=N,c.mat2=L,c.mat3=F,c.mat4=y,c.quat4=s);return{glMatrixArrayType:l,MatrixArray:l,setMatrixArrayType:d,determineMatrixArrayType:f,glMath:g,vec2:M,vec3:j,vec4:N,mat2:L,mat3:F,mat4:y,quat4:s}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * vColor;","}"]; -PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"]; -PIXI.CompileVertexShader=function(c,d){for(var f="",g=0;g>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/examples/bunny benchmark/index.html b/examples/bunny benchmark/index.html index 7c5521b..95972c4 100644 --- a/examples/bunny benchmark/index.html +++ b/examples/bunny benchmark/index.html @@ -9,9 +9,10 @@ +
    Click to add more bunnys! Let me know how many you get on screen here @doormat23
    - + diff --git a/examples/bunny benchmark/js/bunnyBenchMark.js b/examples/bunny benchmark/js/bunnyBenchMark.js index a3154eb..c3c8ec5 100644 --- a/examples/bunny benchmark/js/bunnyBenchMark.js +++ b/examples/bunny benchmark/js/bunnyBenchMark.js @@ -22,18 +22,13 @@ var count = 0; var container; +var detail; + function onReady() { - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() + detail = document.getElementById("pixi"); - if(webgl) - { - renderer = new PIXI.WebGLRenderer(); - } - else - { - renderer = new PIXI.CanvasRenderer(480, 320); - } + renderer = PIXI.autoDetectRenderer(); stage = new PIXI.Stage; @@ -46,7 +41,7 @@ stats.domElement.style.top = "0px"; requestAnimFrame(update); - wabbitTexture = new PIXI.Texture("wabbit.png") + wabbitTexture = new PIXI.Texture.fromImage("wabbit.png") counter = document.createElement("div"); counter.className = "counter"; @@ -55,7 +50,6 @@ count = startBunnyCount; counter.innerHTML = count + " BUNNIES"; - container = new PIXI.DisplayObjectContainer(); stage.addChild(container); @@ -114,7 +108,9 @@ minX = 0; maxY = height; minY = 0; - + + detail.style.left = width - 204 + "px"; + detail.style.top = height - 100 + "px"; renderer.resize(width, height); } @@ -126,17 +122,17 @@ { // add 10 at a time :) - for (var i = 0; i < 2; i++) + for (var i = 0; i < 10; i++) { - var bunny = new PIXI.Sprite(wabbitTexture, {x:0, y:0, width:26, height:37}); + var bunny = new PIXI.Sprite(wabbitTexture); bunny.speedX = Math.random() * 10; bunny.speedY = (Math.random() * 10) - 5; bunny.anchor.x = 0.5; bunny.anchor.y = 1; - bunny.alpha = 0.3 + Math.random() * 0.7; + //bunny.alpha = 0.3 + Math.random() * 0.7; bunnys.push(bunny); - bunny.rotation = Math.random() - 0.5; + //bunny.rotation = Math.random() - 0.5; container.addChild(bunny); count++; diff --git a/examples/bunny benchmark/js/pixi.js b/examples/bunny benchmark/js/pixi.js new file mode 100644 index 0000000..65add09 --- /dev/null +++ b/examples/bunny benchmark/js/pixi.js @@ -0,0 +1,110 @@ +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, +d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* +j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= +a[0]-d[0],c=a[1]-d[1];a=a[2]-d[2];d=Math.sqrt(b*b+c*c+a*a);if(!d)return j[0]=0,j[1]=0,j[2]=0,j;d=1/d;j[0]=b*d;j[1]=c*d;j[2]=a*d;return j},lerp:function(a,d,j,b){b||(b=a);b[0]=a[0]+j*(d[0]-a[0]);b[1]=a[1]+j*(d[1]-a[1]);b[2]=a[2]+j*(d[2]-a[2]);return b},dist:function(a,d){var j=d[0]-a[0],b=d[1]-a[1],c=d[2]-a[2];return Math.sqrt(j*j+b*b+c*c)}},p=null,q=new k(4);l.unproject=function(a,d,j,b,c){c||(c=a);p||(p=t.create());var e=p;q[0]=2*(a[0]-b[0])/b[2]-1;q[1]=2*(a[1]-b[1])/b[3]-1;q[2]=2*a[2]-1;q[3]=1; +t.multiply(j,d,e);if(!t.inverse(e))return null;t.multiplyVec4(e,q);if(0===q[3])return null;c[0]=q[0]/q[3];c[1]=q[1]/q[3];c[2]=q[2]/q[3];return c};var C=l.createFrom(1,0,0),F=l.createFrom(0,1,0),u=l.createFrom(0,0,1),w=l.create();l.rotationTo=function(a,d,j){j||(j=m.create());var b=l.dot(a,d);if(1<=b)m.set(H,j);else if(-0.999999>b)l.cross(C,a,w),1E-6>l.length(w)&&l.cross(F,a,w),1E-6>l.length(w)&&l.cross(u,a,w),l.normalize(w),m.fromAngleAxis(Math.PI,w,j);else{var b=Math.sqrt(2*(1+b)),c=1/b;l.cross(a, +d,w);j[0]=w[0]*c;j[1]=w[1]*c;j[2]=w[2]*c;j[3]=0.5*b;m.normalize(j)}1j[3]&&(j[3]=-1);return j};l.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var x={create:function(a){var d=new k(9);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8]):d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=0;return d},createFrom:function(a,d,j,b,c,e,n,f,E){var s=new k(9);s[0]=a;s[1]=d;s[2]=j;s[3]=b;s[4]=c;s[5]=e;s[6]=n;s[7]=f;s[8]=E;return s},determinant:function(a){var d= +a[3],j=a[4],b=a[5],c=a[6],e=a[7],n=a[8];return a[0]*(n*j-b*e)+a[1]*(-n*d+b*c)+a[2]*(e*d-j*c)},inverse:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[3],n=a[4],f=a[5],E=a[6],s=a[7],I=a[8],g=I*n-f*s,h=-I*e+f*E,k=s*e-n*E,r=j*g+b*h+c*k;if(!r)return null;r=1/r;d||(d=x.create());d[0]=g*r;d[1]=(-I*b+c*s)*r;d[2]=(f*b-c*n)*r;d[3]=h*r;d[4]=(I*j-c*E)*r;d[5]=(-f*j+c*e)*r;d[6]=k*r;d[7]=(-s*j+b*E)*r;d[8]=(n*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],D=a[4],E=a[5],s=a[6],I= +a[7];a=a[8];var g=d[0],h=d[1],k=d[2],r=d[3],m=d[4],l=d[5],q=d[6],v=d[7];d=d[8];j[0]=g*b+h*f+k*s;j[1]=g*c+h*D+k*I;j[2]=g*e+h*E+k*a;j[3]=r*b+m*f+l*s;j[4]=r*c+m*D+l*I;j[5]=r*e+m*E+l*a;j[6]=q*b+v*f+d*s;j[7]=q*c+v*D+d*I;j[8]=q*e+v*E+d*a;return j},multiplyVec2:function(a,d,j){j||(j=d);var b=d[0];d=d[1];j[0]=b*a[0]+d*a[3]+a[6];j[1]=b*a[1]+d*a[4]+a[7];return j},multiplyVec3:function(a,d,j){j||(j=d);var b=d[0],c=d[1];d=d[2];j[0]=b*a[0]+c*a[3]+d*a[6];j[1]=b*a[1]+c*a[4]+d*a[7];j[2]=b*a[2]+c*a[5]+d*a[8];return j}, +set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])},identity:function(a){a||(a=x.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, +d){if(!d||a===d){var j=a[1],b=a[2],c=a[5];a[1]=a[3];a[2]=a[6];a[3]=j;a[5]=a[7];a[6]=b;a[7]=c;return a}d[0]=a[0];d[1]=a[3];d[2]=a[6];d[3]=a[1];d[4]=a[4];d[5]=a[7];d[6]=a[2];d[7]=a[5];d[8]=a[8];return d},toMat4:function(a,d){d||(d=t.create());d[15]=1;d[14]=0;d[13]=0;d[12]=0;d[11]=0;d[10]=a[8];d[9]=a[7];d[8]=a[6];d[7]=0;d[6]=a[5];d[5]=a[4];d[4]=a[3];d[3]=0;d[2]=a[2];d[1]=a[1];d[0]=a[0];return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ +a[8]+"]"}},t={create:function(a){var d=new k(16);a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8],d[9]=a[9],d[10]=a[10],d[11]=a[11],d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d},createFrom:function(a,d,j,b,c,e,f,D,E,s,g,h,m,l,r,q){var A=new k(16);A[0]=a;A[1]=d;A[2]=j;A[3]=b;A[4]=c;A[5]=e;A[6]=f;A[7]=D;A[8]=E;A[9]=s;A[10]=g;A[11]=h;A[12]=m;A[13]=l;A[14]=r;A[15]=q;return A},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4]; +d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=a[12];d[13]=a[13];d[14]=a[14];d[15]=a[15];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])&&1E-6>Math.abs(a[9]-d[9])&&1E-6>Math.abs(a[10]-d[10])&&1E-6>Math.abs(a[11]-d[11])&&1E-6>Math.abs(a[12]- +d[12])&&1E-6>Math.abs(a[13]-d[13])&&1E-6>Math.abs(a[14]-d[14])&&1E-6>Math.abs(a[15]-d[15])},identity:function(a){a||(a=t.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,d){if(!d||a===d){var j=a[1],b=a[2],c=a[3],e=a[6],f=a[7],D=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=j;a[6]=a[9];a[7]=a[13];a[8]=b;a[9]=e;a[11]=a[14];a[12]=c;a[13]=f;a[14]=D;return a}d[0]=a[0];d[1]=a[4];d[2]=a[8];d[3]=a[12]; +d[4]=a[1];d[5]=a[5];d[6]=a[9];d[7]=a[13];d[8]=a[2];d[9]=a[6];d[10]=a[10];d[11]=a[14];d[12]=a[3];d[13]=a[7];d[14]=a[11];d[15]=a[15];return d},determinant:function(a){var d=a[0],j=a[1],b=a[2],c=a[3],e=a[4],f=a[5],D=a[6],E=a[7],s=a[8],g=a[9],h=a[10],k=a[11],m=a[12],r=a[13],l=a[14];a=a[15];return m*g*D*c-s*r*D*c-m*f*h*c+e*r*h*c+s*f*l*c-e*g*l*c-m*g*b*E+s*r*b*E+m*j*h*E-d*r*h*E-s*j*l*E+d*g*l*E+m*f*b*k-e*r*b*k-m*j*D*k+d*r*D*k+e*j*l*k-d*f*l*k-s*f*b*a+e*g*b*a+s*j*D*a-d*g*D*a-e*j*h*a+d*f*h*a},inverse:function(a, +d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=a[3],f=a[4],D=a[5],E=a[6],s=a[7],g=a[8],h=a[9],k=a[10],m=a[11],r=a[12],l=a[13],A=a[14],q=a[15],v=j*D-b*f,J=j*E-c*f,y=j*s-e*f,z=b*E-c*D,t=b*s-e*D,u=c*s-e*E,p=g*l-h*r,w=g*A-k*r,x=g*q-m*r,B=h*A-k*l,C=h*q-m*l,F=k*q-m*A,G=v*F-J*C+y*B+z*x-t*w+u*p;if(!G)return null;G=1/G;d[0]=(D*F-E*C+s*B)*G;d[1]=(-b*F+c*C-e*B)*G;d[2]=(l*u-A*t+q*z)*G;d[3]=(-h*u+k*t-m*z)*G;d[4]=(-f*F+E*x-s*w)*G;d[5]=(j*F-c*x+e*w)*G;d[6]=(-r*u+A*y-q*J)*G;d[7]=(g*u-k*y+m*J)*G;d[8]=(f*C-D*x+s*p)*G;d[9]= +(-j*C+b*x-e*p)*G;d[10]=(r*t-l*y+q*v)*G;d[11]=(-g*t+h*y-m*v)*G;d[12]=(-f*B+D*w-E*p)*G;d[13]=(j*B-b*w+c*p)*G;d[14]=(-r*z+l*J-A*v)*G;d[15]=(g*z-h*J+k*v)*G;return d},toRotationMat:function(a,d){d||(d=t.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d},toMat3:function(a,d){d||(d=x.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[4];d[4]=a[5];d[5]=a[6];d[6]=a[8];d[7]=a[9];d[8]=a[10]; +return d},toInverseMat3:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[4],f=a[5],D=a[6],g=a[8],s=a[9],h=a[10],k=h*f-D*s,m=-h*e+D*g,l=s*e-f*g,r=j*k+b*m+c*l;if(!r)return null;r=1/r;d||(d=x.create());d[0]=k*r;d[1]=(-h*b+c*s)*r;d[2]=(D*b-c*f)*r;d[3]=m*r;d[4]=(h*j-c*g)*r;d[5]=(-D*j+c*e)*r;d[6]=l*r;d[7]=(-s*j+b*g)*r;d[8]=(f*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],s=a[6],k=a[7],m=a[8],l=a[9],q=a[10],r=a[11],t=a[12],A=a[13],u=a[14];a=a[15];var v=d[0], +p=d[1],y=d[2],z=d[3];j[0]=v*b+p*g+y*m+z*t;j[1]=v*c+p*h+y*l+z*A;j[2]=v*e+p*s+y*q+z*u;j[3]=v*f+p*k+y*r+z*a;v=d[4];p=d[5];y=d[6];z=d[7];j[4]=v*b+p*g+y*m+z*t;j[5]=v*c+p*h+y*l+z*A;j[6]=v*e+p*s+y*q+z*u;j[7]=v*f+p*k+y*r+z*a;v=d[8];p=d[9];y=d[10];z=d[11];j[8]=v*b+p*g+y*m+z*t;j[9]=v*c+p*h+y*l+z*A;j[10]=v*e+p*s+y*q+z*u;j[11]=v*f+p*k+y*r+z*a;v=d[12];p=d[13];y=d[14];z=d[15];j[12]=v*b+p*g+y*m+z*t;j[13]=v*c+p*h+y*l+z*A;j[14]=v*e+p*s+y*q+z*u;j[15]=v*f+p*k+y*r+z*a;return j},multiplyVec3:function(a,d,b){b||(b=d); +var c=d[0],e=d[1];d=d[2];b[0]=a[0]*c+a[4]*e+a[8]*d+a[12];b[1]=a[1]*c+a[5]*e+a[9]*d+a[13];b[2]=a[2]*c+a[6]*e+a[10]*d+a[14];return b},multiplyVec4:function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=d[3];b[0]=a[0]*c+a[4]*e+a[8]*f+a[12]*d;b[1]=a[1]*c+a[5]*e+a[9]*f+a[13]*d;b[2]=a[2]*c+a[6]*e+a[10]*f+a[14]*d;b[3]=a[3]*c+a[7]*e+a[11]*f+a[15]*d;return b},translate:function(a,d,b){var c=d[0],e=d[1];d=d[2];var f,n,g,h,s,k,m,l,p,r,q,t;if(!b||a===b)return a[12]=a[0]*c+a[4]*e+a[8]*d+a[12],a[13]=a[1]*c+a[5]*e+ +a[9]*d+a[13],a[14]=a[2]*c+a[6]*e+a[10]*d+a[14],a[15]=a[3]*c+a[7]*e+a[11]*d+a[15],a;f=a[0];n=a[1];g=a[2];h=a[3];s=a[4];k=a[5];m=a[6];l=a[7];p=a[8];r=a[9];q=a[10];t=a[11];b[0]=f;b[1]=n;b[2]=g;b[3]=h;b[4]=s;b[5]=k;b[6]=m;b[7]=l;b[8]=p;b[9]=r;b[10]=q;b[11]=t;b[12]=f*c+s*e+p*d+a[12];b[13]=n*c+k*e+r*d+a[13];b[14]=g*c+m*e+q*d+a[14];b[15]=h*c+l*e+t*d+a[15];return b},scale:function(a,d,b){var c=d[0],e=d[1];d=d[2];if(!b||a===b)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=d,a[9]*= +d,a[10]*=d,a[11]*=d,a;b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[7]=a[7]*e;b[8]=a[8]*d;b[9]=a[9]*d;b[10]=a[10]*d;b[11]=a[11]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},rotate:function(a,d,b,c){var e=b[0],f=b[1];b=b[2];var n=Math.sqrt(e*e+f*f+b*b),g,h,k,m,l,p,q,r,t,u,w,v,x,y,z,B,C,F,H,K;if(!n)return null;1!==n&&(n=1/n,e*=n,f*=n,b*=n);g=Math.sin(d);h=Math.cos(d);k=1-h;d=a[0];n=a[1];m=a[2];l=a[3];p=a[4];q=a[5];r=a[6];t=a[7];u=a[8];w=a[9];v= +a[10];x=a[11];y=e*e*k+h;z=f*e*k+b*g;B=b*e*k-f*g;C=e*f*k-b*g;F=f*f*k+h;H=b*f*k+e*g;K=e*b*k+f*g;e=f*b*k-e*g;f=b*b*k+h;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=d*y+p*z+u*B;c[1]=n*y+q*z+w*B;c[2]=m*y+r*z+v*B;c[3]=l*y+t*z+x*B;c[4]=d*C+p*F+u*H;c[5]=n*C+q*F+w*H;c[6]=m*C+r*F+v*H;c[7]=l*C+t*F+x*H;c[8]=d*K+p*e+u*f;c[9]=n*K+q*e+w*f;c[10]=m*K+r*e+v*f;c[11]=l*K+t*e+x*f;return c},rotateX:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[4],f=a[5],n=a[6],g=a[7],h=a[8],k=a[9],m=a[10], +l=a[11];b?a!==b&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[4]=e*d+h*c;b[5]=f*d+k*c;b[6]=n*d+m*c;b[7]=g*d+l*c;b[8]=e*-c+h*d;b[9]=f*-c+k*d;b[10]=n*-c+m*d;b[11]=g*-c+l*d;return b},rotateY:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[8],k=a[9],m=a[10],l=a[11];b?a!==b&&(b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*-c;b[1]=f*d+k*-c;b[2]=n*d+m*-c;b[3]=g* +d+l*-c;b[8]=e*c+h*d;b[9]=f*c+k*d;b[10]=n*c+m*d;b[11]=g*c+l*d;return b},rotateZ:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[4],k=a[5],m=a[6],l=a[7];b?a!==b&&(b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*c;b[1]=f*d+k*c;b[2]=n*d+m*c;b[3]=g*d+l*c;b[4]=e*-c+h*d;b[5]=f*-c+k*d;b[6]=n*-c+m*d;b[7]=g*-c+l*d;return b},frustum:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2*e/g;n[1]=0; +n[2]=0;n[3]=0;n[4]=0;n[5]=2*e/h;n[6]=0;n[7]=0;n[8]=(d+a)/g;n[9]=(c+b)/h;n[10]=-(f+e)/k;n[11]=-1;n[12]=0;n[13]=0;n[14]=-(2*f*e)/k;n[15]=0;return n},perspective:function(a,d,b,c,e){a=b*Math.tan(a*Math.PI/360);d*=a;return t.frustum(-d,d,-a,a,b,c,e)},ortho:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2/g;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=2/h;n[6]=0;n[7]=0;n[8]=0;n[9]=0;n[10]=-2/k;n[11]=0;n[12]=-(a+d)/g;n[13]=-(c+b)/h;n[14]=-(f+e)/k;n[15]=1;return n},lookAt:function(a,d,b,c){c|| +(c=t.create());var e,f,n,g,h,k,m,l,p=a[0],q=a[1];a=a[2];n=b[0];g=b[1];f=b[2];m=d[0];b=d[1];e=d[2];if(p===m&&q===b&&a===e)return t.identity(c);d=p-m;b=q-b;m=a-e;l=1/Math.sqrt(d*d+b*b+m*m);d*=l;b*=l;m*=l;e=g*m-f*b;f=f*d-n*m;n=n*b-g*d;(l=Math.sqrt(e*e+f*f+n*n))?(l=1/l,e*=l,f*=l,n*=l):n=f=e=0;g=b*n-m*f;h=m*e-d*n;k=d*f-b*e;(l=Math.sqrt(g*g+h*h+k*k))?(l=1/l,g*=l,h*=l,k*=l):k=h=g=0;c[0]=e;c[1]=g;c[2]=d;c[3]=0;c[4]=f;c[5]=h;c[6]=b;c[7]=0;c[8]=n;c[9]=k;c[10]=m;c[11]=0;c[12]=-(e*p+f*q+n*a);c[13]=-(g*p+h*q+ +k*a);c[14]=-(d*p+b*q+m*a);c[15]=1;return c},fromRotationTranslation:function(a,d,b){b||(b=t.create());var c=a[0],e=a[1],f=a[2],n=a[3],g=c+c,h=e+e,k=f+f;a=c*g;var l=c*h,c=c*k,m=e*h,e=e*k,f=f*k,g=n*g,h=n*h,n=n*k;b[0]=1-(m+f);b[1]=l+n;b[2]=c-h;b[3]=0;b[4]=l-n;b[5]=1-(a+f);b[6]=e+g;b[7]=0;b[8]=c+h;b[9]=e-g;b[10]=1-(a+m);b[11]=0;b[12]=d[0];b[13]=d[1];b[14]=d[2];b[15]=1;return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ +a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},m={create:function(a){var d=new k(4);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]):d[0]=d[1]=d[2]=d[3]=0;return d},createFrom:function(a,d,b,c){var e=new k(4);e[0]=a;e[1]=d;e[2]=b;e[3]=c;return e},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])},identity:function(a){a||(a=m.create()); +a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},H=m.identity();m.calculateW=function(a,d){var b=a[0],c=a[1],e=a[2];if(!d||a===d)return a[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e)),a;d[0]=b;d[1]=c;d[2]=e;d[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e));return d};m.dot=function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3]};m.inverse=function(a,d){var b=a[0],c=a[1],e=a[2],f=a[3],b=(b=b*b+c*c+e*e+f*f)?1/b:0;if(!d||a===d)return a[0]*=-b,a[1]*=-b,a[2]*=-b,a[3]*=b,a;d[0]=-a[0]*b;d[1]=-a[1]*b;d[2]=-a[2]*b;d[3]=a[3]*b; +return d};m.conjugate=function(a,d){if(!d||a===d)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=a[3];return d};m.length=function(a){var d=a[0],b=a[1],c=a[2];a=a[3];return Math.sqrt(d*d+b*b+c*c+a*a)};m.normalize=function(a,d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=Math.sqrt(b*b+c*c+e*e+f*f);if(0===g)return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d;g=1/g;d[0]=b*g;d[1]=c*g;d[2]=e*g;d[3]=f*g;return d};m.add=function(a,d,b){if(!b||a===b)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a[3]+= +d[3],a;b[0]=a[0]+d[0];b[1]=a[1]+d[1];b[2]=a[2]+d[2];b[3]=a[3]+d[3];return b};m.multiply=function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2];a=a[3];var g=d[0],h=d[1],k=d[2];d=d[3];b[0]=c*d+a*g+e*k-f*h;b[1]=e*d+a*h+f*g-c*k;b[2]=f*d+a*k+c*h-e*g;b[3]=a*d-c*g-e*h-f*k;return b};m.multiplyVec3=function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=a[0];var g=a[1],h=a[2];a=a[3];var k=a*c+g*f-h*e,l=a*e+h*c-d*f,m=a*f+d*e-g*c,c=-d*c-g*e-h*f;b[0]=k*a+c*-d+l*-h-m*-g;b[1]=l*a+c*-g+m*-d-k*-h;b[2]=m*a+c*-h+k*-g-l*-d; +return b};m.scale=function(a,d,b){if(!b||a===b)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a;b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[3]=a[3]*d;return b};m.toMat3=function(a,d){d||(d=x.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b*k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=m-f;d[4]=1-(l+e);d[5]=c+g;d[6]=b+h;d[7]=c-g;d[8]=1-(l+p);return d};m.toMat4=function(a,d){d||(d=t.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b* +k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=0;d[4]=m-f;d[5]=1-(l+e);d[6]=c+g;d[7]=0;d[8]=b+h;d[9]=c-g;d[10]=1-(l+p);d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d};m.slerp=function(a,d,b,c){c||(c=a);var e=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3],f,g;if(1<=Math.abs(e))return c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]),c;f=Math.acos(e);g=Math.sqrt(1-e*e);if(0.0010>Math.abs(g))return c[0]=0.5*a[0]+0.5*d[0],c[1]=0.5*a[1]+0.5*d[1],c[2]=0.5*a[2]+0.5*d[2],c[3]=0.5*a[3]+ +0.5*d[3],c;e=Math.sin((1-b)*f)/g;b=Math.sin(b*f)/g;c[0]=a[0]*e+d[0]*b;c[1]=a[1]*e+d[1]*b;c[2]=a[2]*e+d[2]*b;c[3]=a[3]*e+d[3]*b;return c};m.fromRotationMatrix=function(a,d){d||(d=m.create());var b=a[0]+a[4]+a[8],c;if(0a[0]&&(b=1);a[8]>a[3*b+b]&&(b=2);var e=c[b],f=c[e];c=Math.sqrt(a[3*b+b]-a[3*e+e]-a[3*f+f]+1);d[b]=0.5*c;c= +0.5/c;d[3]=(a[3*f+e]-a[3*e+f])*c;d[e]=(a[3*e+b]+a[3*b+e])*c;d[f]=(a[3*f+b]+a[3*b+f])*c}return d};x.toQuat4=m.fromRotationMatrix;var B=x.create();m.fromAxes=function(a,d,b,c){B[0]=d[0];B[3]=d[1];B[6]=d[2];B[1]=b[0];B[4]=b[1];B[7]=b[2];B[2]=a[0];B[5]=a[1];B[8]=a[2];return m.fromRotationMatrix(B,c)};m.identity=function(a){a||(a=m.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};m.fromAngleAxis=function(a,d,b){b||(b=m.create());a*=0.5;var c=Math.sin(a);b[3]=Math.cos(a);b[0]=c*d[0];b[1]=c*d[1];b[2]=c*d[2]; +return b};m.toAngleAxis=function(a,d){d||(d=a);var b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); +b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 +Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],e=a[1],f=a[2],g=a[3],h=c*g-f*e;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-e*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, +b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];c[0]=e*b[0]+f*b[2];c[1]=e*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=e*b+f*h;c[1]=e*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var e=b[0];b=b[1];c[0]=e*a[0]+b*a[1];c[1]=e*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var e=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=e*b;c[2]=f*h;c[3]= +g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, +b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| +(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= +f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; +PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; +PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l>1);var b=m[0];return b*(1.5-0.5*a*b*b)}}else g.invsqrt=function(a){return 1/Math.sqrt(a)}; -var l=null;f();var j={create:function(a){var b=new l(3);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0;return b},createFrom:function(a,b,e){var c=new l(3);c[0]=a;c[1]=b;c[2]=e;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])},add:function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];return e},subtract:function(a, -b,e){if(!e||a===e)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];return e},multiply:function(a,b,e){if(!e||a===e)return a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a;e[0]=a[0]*b[0];e[1]=a[1]*b[1];e[2]=a[2]*b[2];return e},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;return e},normalize:function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=Math.sqrt(e* -e+c*c+d*d);if(!k)return b[0]=0,b[1]=0,b[2]=0,b;if(1===k)return b[0]=e,b[1]=c,b[2]=d,b;k=1/k;b[0]=e*k;b[1]=c*k;b[2]=d*k;return b},cross:function(a,b,e){e||(e=a);var c=a[0],d=a[1];a=a[2];var k=b[0],h=b[1];b=b[2];e[0]=d*b-a*h;e[1]=a*k-c*b;e[2]=c*h-d*k;return e},length:function(a){var b=a[0],e=a[1];a=a[2];return Math.sqrt(b*b+e*e+a*a)},squaredLength:function(a){var b=a[0],e=a[1];a=a[2];return b*b+e*e+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,b,e){e||(e=a);var c= -a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];b=Math.sqrt(c*c+d*d+a*a);if(!b)return e[0]=0,e[1]=0,e[2]=0,e;b=1/b;e[0]=c*b;e[1]=d*b;e[2]=a*b;return e},lerp:function(a,b,e,c){c||(c=a);c[0]=a[0]+e*(b[0]-a[0]);c[1]=a[1]+e*(b[1]-a[1]);c[2]=a[2]+e*(b[2]-a[2]);return c},dist:function(a,b){var e=b[0]-a[0],c=b[1]-a[1],d=b[2]-a[2];return Math.sqrt(e*e+c*c+d*d)}},x=null,n=new l(4);j.unproject=function(a,b,e,c,d){d||(d=a);x||(x=y.create());var k=x;n[0]=2*(a[0]-c[0])/c[2]-1;n[1]=2*(a[1]-c[1])/c[3]-1;n[2]=2*a[2]-1;n[3]=1; -y.multiply(e,b,k);if(!y.inverse(k))return null;y.multiplyVec4(k,n);if(0===n[3])return null;d[0]=n[0]/n[3];d[1]=n[1]/n[3];d[2]=n[2]/n[3];return d};var z=j.createFrom(1,0,0),A=j.createFrom(0,1,0),H=j.createFrom(0,0,1),C=j.create();j.rotationTo=function(a,b,e){e||(e=s.create());var c=j.dot(a,b);if(1<=c)s.set(O,e);else if(-0.999999>c)j.cross(z,a,C),1E-6>j.length(C)&&j.cross(A,a,C),1E-6>j.length(C)&&j.cross(H,a,C),j.normalize(C),s.fromAngleAxis(Math.PI,C,e);else{var c=Math.sqrt(2*(1+c)),d=1/c;j.cross(a, -b,C);e[0]=C[0]*d;e[1]=C[1]*d;e[2]=C[2]*d;e[3]=0.5*c;s.normalize(e)}1e[3]&&(e[3]=-1);return e};j.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var F={create:function(a){var b=new l(9);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0;return b},createFrom:function(a,b,e,c,d,k,h,E,K){var q=new l(9);q[0]=a;q[1]=b;q[2]=e;q[3]=c;q[4]=d;q[5]=k;q[6]=h;q[7]=E;q[8]=K;return q},determinant:function(a){var b= -a[3],e=a[4],c=a[5],d=a[6],k=a[7],h=a[8];return a[0]*(h*e-c*k)+a[1]*(-h*b+c*d)+a[2]*(k*b-e*d)},inverse:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],E=a[5],K=a[6],q=a[7],f=a[8],g=f*h-E*q,j=-f*k+E*K,J=q*k-h*K,r=e*g+c*j+d*J;if(!r)return null;r=1/r;b||(b=F.create());b[0]=g*r;b[1]=(-f*c+d*q)*r;b[2]=(E*c-d*h)*r;b[3]=j*r;b[4]=(f*e-d*K)*r;b[5]=(-E*e+d*k)*r;b[6]=J*r;b[7]=(-q*e+c*K)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],E=a[4],f=a[5],q=a[6],g= -a[7];a=a[8];var u=b[0],j=b[1],J=b[2],r=b[3],l=b[4],t=b[5],m=b[6],p=b[7];b=b[8];e[0]=u*c+j*h+J*q;e[1]=u*d+j*E+J*g;e[2]=u*k+j*f+J*a;e[3]=r*c+l*h+t*q;e[4]=r*d+l*E+t*g;e[5]=r*k+l*f+t*a;e[6]=m*c+p*h+b*q;e[7]=m*d+p*E+b*g;e[8]=m*k+p*f+b*a;return e},multiplyVec2:function(a,b,e){e||(e=b);var c=b[0];b=b[1];e[0]=c*a[0]+b*a[3]+a[6];e[1]=c*a[1]+b*a[4]+a[7];return e},multiplyVec3:function(a,b,e){e||(e=b);var c=b[0],d=b[1];b=b[2];e[0]=c*a[0]+d*a[3]+b*a[6];e[1]=c*a[1]+d*a[4]+b*a[7];e[2]=c*a[2]+d*a[5]+b*a[8];return e}, -set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])},identity:function(a){a||(a=F.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, -b){if(!b||a===b){var e=a[1],c=a[2],d=a[5];a[1]=a[3];a[2]=a[6];a[3]=e;a[5]=a[7];a[6]=c;a[7]=d;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]=a[8];return b},toMat4:function(a,b){b||(b=y.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ -a[8]+"]"}},y={create:function(a){var b=new l(16);a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]);return b},createFrom:function(a,b,e,c,d,k,h,E,f,q,g,u,j,J,r,m){var t=new l(16);t[0]=a;t[1]=b;t[2]=e;t[3]=c;t[4]=d;t[5]=k;t[6]=h;t[7]=E;t[8]=f;t[9]=q;t[10]=g;t[11]=u;t[12]=j;t[13]=J;t[14]=r;t[15]=m;return t},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4]; -b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])&&1E-6>Math.abs(a[9]-b[9])&&1E-6>Math.abs(a[10]-b[10])&&1E-6>Math.abs(a[11]-b[11])&&1E-6>Math.abs(a[12]- -b[12])&&1E-6>Math.abs(a[13]-b[13])&&1E-6>Math.abs(a[14]-b[14])&&1E-6>Math.abs(a[15]-b[15])},identity:function(a){a||(a=y.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){var e=a[1],c=a[2],d=a[3],k=a[6],h=a[7],E=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=e;a[6]=a[9];a[7]=a[13];a[8]=c;a[9]=k;a[11]=a[14];a[12]=d;a[13]=h;a[14]=E;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12]; -b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b=a[0],e=a[1],c=a[2],d=a[3],k=a[4],h=a[5],E=a[6],f=a[7],g=a[8],I=a[9],u=a[10],j=a[11],l=a[12],r=a[13],m=a[14];a=a[15];return l*I*E*d-g*r*E*d-l*h*u*d+k*r*u*d+g*h*m*d-k*I*m*d-l*I*c*f+g*r*c*f+l*e*u*f-b*r*u*f-g*e*m*f+b*I*m*f+l*h*c*j-k*r*c*j-l*e*E*j+b*r*E*j+k*e*m*j-b*h*m*j-g*h*c*a+k*I*c*a+g*e*E*a-b*I*E*a-k*e*u*a+b*h*u*a},inverse:function(a, -b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],f=a[5],g=a[6],q=a[7],I=a[8],u=a[9],j=a[10],l=a[11],r=a[12],m=a[13],t=a[14],p=a[15],s=e*f-c*h,n=e*g-d*h,v=e*q-k*h,w=c*g-d*f,x=c*q-k*f,y=d*q-k*g,z=I*m-u*r,A=I*t-j*r,C=I*p-l*r,D=u*t-j*m,F=u*p-l*m,H=j*p-l*t,G=s*H-n*F+v*D+w*C-x*A+y*z;if(!G)return null;G=1/G;b[0]=(f*H-g*F+q*D)*G;b[1]=(-c*H+d*F-k*D)*G;b[2]=(m*y-t*x+p*w)*G;b[3]=(-u*y+j*x-l*w)*G;b[4]=(-h*H+g*C-q*A)*G;b[5]=(e*H-d*C+k*A)*G;b[6]=(-r*y+t*v-p*n)*G;b[7]=(I*y-j*v+l*n)*G;b[8]=(h*F-f*C+q*z)*G;b[9]= -(-e*F+c*C-k*z)*G;b[10]=(r*x-m*v+p*s)*G;b[11]=(-I*x+u*v-l*s)*G;b[12]=(-h*D+f*A-g*z)*G;b[13]=(e*D-c*A+d*z)*G;b[14]=(-r*w+m*n-t*s)*G;b[15]=(I*w-u*n+j*s)*G;return b},toRotationMat:function(a,b){b||(b=y.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=F.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10]; -return b},toInverseMat3:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[4],h=a[5],f=a[6],g=a[8],q=a[9],j=a[10],u=j*h-f*q,l=-j*k+f*g,m=q*k-h*g,r=e*u+c*l+d*m;if(!r)return null;r=1/r;b||(b=F.create());b[0]=u*r;b[1]=(-j*c+d*q)*r;b[2]=(f*c-d*h)*r;b[3]=l*r;b[4]=(j*e-d*g)*r;b[5]=(-f*e+d*k)*r;b[6]=m*r;b[7]=(-q*e+c*g)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],f=a[4],g=a[5],q=a[6],j=a[7],u=a[8],l=a[9],m=a[10],r=a[11],p=a[12],t=a[13],s=a[14];a=a[15];var n=b[0], -B=b[1],v=b[2],w=b[3];e[0]=n*c+B*f+v*u+w*p;e[1]=n*d+B*g+v*l+w*t;e[2]=n*k+B*q+v*m+w*s;e[3]=n*h+B*j+v*r+w*a;n=b[4];B=b[5];v=b[6];w=b[7];e[4]=n*c+B*f+v*u+w*p;e[5]=n*d+B*g+v*l+w*t;e[6]=n*k+B*q+v*m+w*s;e[7]=n*h+B*j+v*r+w*a;n=b[8];B=b[9];v=b[10];w=b[11];e[8]=n*c+B*f+v*u+w*p;e[9]=n*d+B*g+v*l+w*t;e[10]=n*k+B*q+v*m+w*s;e[11]=n*h+B*j+v*r+w*a;n=b[12];B=b[13];v=b[14];w=b[15];e[12]=n*c+B*f+v*u+w*p;e[13]=n*d+B*g+v*l+w*t;e[14]=n*k+B*q+v*m+w*s;e[15]=n*h+B*j+v*r+w*a;return e},multiplyVec3:function(a,b,e){e||(e=b); -var c=b[0],d=b[1];b=b[2];e[0]=a[0]*c+a[4]*d+a[8]*b+a[12];e[1]=a[1]*c+a[5]*d+a[9]*b+a[13];e[2]=a[2]*c+a[6]*d+a[10]*b+a[14];return e},multiplyVec4:function(a,b,e){e||(e=b);var c=b[0],d=b[1],k=b[2];b=b[3];e[0]=a[0]*c+a[4]*d+a[8]*k+a[12]*b;e[1]=a[1]*c+a[5]*d+a[9]*k+a[13]*b;e[2]=a[2]*c+a[6]*d+a[10]*k+a[14]*b;e[3]=a[3]*c+a[7]*d+a[11]*k+a[15]*b;return e},translate:function(a,b,e){var c=b[0],d=b[1];b=b[2];var k,h,f,g,q,j,u,l,m,n,p,s;if(!e||a===e)return a[12]=a[0]*c+a[4]*d+a[8]*b+a[12],a[13]=a[1]*c+a[5]*d+ -a[9]*b+a[13],a[14]=a[2]*c+a[6]*d+a[10]*b+a[14],a[15]=a[3]*c+a[7]*d+a[11]*b+a[15],a;k=a[0];h=a[1];f=a[2];g=a[3];q=a[4];j=a[5];u=a[6];l=a[7];m=a[8];n=a[9];p=a[10];s=a[11];e[0]=k;e[1]=h;e[2]=f;e[3]=g;e[4]=q;e[5]=j;e[6]=u;e[7]=l;e[8]=m;e[9]=n;e[10]=p;e[11]=s;e[12]=k*c+q*d+m*b+a[12];e[13]=h*c+j*d+n*b+a[13];e[14]=f*c+u*d+p*b+a[14];e[15]=g*c+l*d+s*b+a[15];return e},scale:function(a,b,e){var c=b[0],d=b[1];b=b[2];if(!e||a===e)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=d,a[5]*=d,a[6]*=d,a[7]*=d,a[8]*=b,a[9]*= -b,a[10]*=b,a[11]*=b,a;e[0]=a[0]*c;e[1]=a[1]*c;e[2]=a[2]*c;e[3]=a[3]*c;e[4]=a[4]*d;e[5]=a[5]*d;e[6]=a[6]*d;e[7]=a[7]*d;e[8]=a[8]*b;e[9]=a[9]*b;e[10]=a[10]*b;e[11]=a[11]*b;e[12]=a[12];e[13]=a[13];e[14]=a[14];e[15]=a[15];return e},rotate:function(a,b,e,c){var d=e[0],k=e[1];e=e[2];var h=Math.sqrt(d*d+k*k+e*e),f,g,q,j,l,m,n,r,p,s,x,y,B,v,w,z,A,C,D,F;if(!h)return null;1!==h&&(h=1/h,d*=h,k*=h,e*=h);f=Math.sin(b);g=Math.cos(b);q=1-g;b=a[0];h=a[1];j=a[2];l=a[3];m=a[4];n=a[5];r=a[6];p=a[7];s=a[8];x=a[9];y= -a[10];B=a[11];v=d*d*q+g;w=k*d*q+e*f;z=e*d*q-k*f;A=d*k*q-e*f;C=k*k*q+g;D=e*k*q+d*f;F=d*e*q+k*f;d=k*e*q-d*f;k=e*e*q+g;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=b*v+m*w+s*z;c[1]=h*v+n*w+x*z;c[2]=j*v+r*w+y*z;c[3]=l*v+p*w+B*z;c[4]=b*A+m*C+s*D;c[5]=h*A+n*C+x*D;c[6]=j*A+r*C+y*D;c[7]=l*A+p*C+B*D;c[8]=b*F+m*d+s*k;c[9]=h*F+n*d+x*k;c[10]=j*F+r*d+y*k;c[11]=l*F+p*d+B*k;return c},rotateX:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[4],k=a[5],h=a[6],f=a[7],g=a[8],q=a[9],j=a[10], -l=a[11];e?a!==e&&(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[4]=d*b+g*c;e[5]=k*b+q*c;e[6]=h*b+j*c;e[7]=f*b+l*c;e[8]=d*-c+g*b;e[9]=k*-c+q*b;e[10]=h*-c+j*b;e[11]=f*-c+l*b;return e},rotateY:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[8],j=a[9],l=a[10],m=a[11];e?a!==e&&(e[4]=a[4],e[5]=a[5],e[6]=a[6],e[7]=a[7],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*-c;e[1]=k*b+j*-c;e[2]=h*b+l*-c;e[3]=f* -b+m*-c;e[8]=d*c+g*b;e[9]=k*c+j*b;e[10]=h*c+l*b;e[11]=f*c+m*b;return e},rotateZ:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[4],j=a[5],l=a[6],m=a[7];e?a!==e&&(e[8]=a[8],e[9]=a[9],e[10]=a[10],e[11]=a[11],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*c;e[1]=k*b+j*c;e[2]=h*b+l*c;e[3]=f*b+m*c;e[4]=d*-c+g*b;e[5]=k*-c+j*b;e[6]=h*-c+l*b;e[7]=f*-c+m*b;return e},frustum:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2*d/f;h[1]=0; -h[2]=0;h[3]=0;h[4]=0;h[5]=2*d/g;h[6]=0;h[7]=0;h[8]=(b+a)/f;h[9]=(c+e)/g;h[10]=-(k+d)/j;h[11]=-1;h[12]=0;h[13]=0;h[14]=-(2*k*d)/j;h[15]=0;return h},perspective:function(a,b,e,c,d){a=e*Math.tan(a*Math.PI/360);b*=a;return y.frustum(-b,b,-a,a,e,c,d)},ortho:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2/f;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/g;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/j;h[11]=0;h[12]=-(a+b)/f;h[13]=-(c+e)/g;h[14]=-(k+d)/j;h[15]=1;return h},lookAt:function(a,b,e,c){c|| -(c=y.create());var d,k,h,f,g,j,l,m,n=a[0],p=a[1];a=a[2];h=e[0];f=e[1];k=e[2];l=b[0];e=b[1];d=b[2];if(n===l&&p===e&&a===d)return y.identity(c);b=n-l;e=p-e;l=a-d;m=1/Math.sqrt(b*b+e*e+l*l);b*=m;e*=m;l*=m;d=f*l-k*e;k=k*b-h*l;h=h*e-f*b;(m=Math.sqrt(d*d+k*k+h*h))?(m=1/m,d*=m,k*=m,h*=m):h=k=d=0;f=e*h-l*k;g=l*d-b*h;j=b*k-e*d;(m=Math.sqrt(f*f+g*g+j*j))?(m=1/m,f*=m,g*=m,j*=m):j=g=f=0;c[0]=d;c[1]=f;c[2]=b;c[3]=0;c[4]=k;c[5]=g;c[6]=e;c[7]=0;c[8]=h;c[9]=j;c[10]=l;c[11]=0;c[12]=-(d*n+k*p+h*a);c[13]=-(f*n+g*p+ -j*a);c[14]=-(b*n+e*p+l*a);c[15]=1;return c},fromRotationTranslation:function(a,b,e){e||(e=y.create());var c=a[0],d=a[1],k=a[2],h=a[3],f=c+c,g=d+d,j=k+k;a=c*f;var l=c*g,c=c*j,m=d*g,d=d*j,k=k*j,f=h*f,g=h*g,h=h*j;e[0]=1-(m+k);e[1]=l+h;e[2]=c-g;e[3]=0;e[4]=l-h;e[5]=1-(a+k);e[6]=d+f;e[7]=0;e[8]=c+g;e[9]=d-f;e[10]=1-(a+m);e[11]=0;e[12]=b[0];e[13]=b[1];e[14]=b[2];e[15]=1;return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ -a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},s={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,e,c){var d=new l(4);d[0]=a;d[1]=b;d[2]=e;d[3]=c;return d},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=s.create()); -a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},O=s.identity();s.calculateW=function(a,b){var e=a[0],c=a[1],d=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d)),a;b[0]=e;b[1]=c;b[2]=d;b[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d));return b};s.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};s.inverse=function(a,b){var e=a[0],c=a[1],d=a[2],f=a[3],e=(e=e*e+c*c+d*d+f*f)?1/e:0;if(!b||a===b)return a[0]*=-e,a[1]*=-e,a[2]*=-e,a[3]*=e,a;b[0]=-a[0]*e;b[1]=-a[1]*e;b[2]=-a[2]*e;b[3]=a[3]*e; -return b};s.conjugate=function(a,b){if(!b||a===b)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};s.length=function(a){var b=a[0],e=a[1],c=a[2];a=a[3];return Math.sqrt(b*b+e*e+c*c+a*a)};s.normalize=function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],f=a[3],h=Math.sqrt(e*e+c*c+d*d+f*f);if(0===h)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;h=1/h;b[0]=e*h;b[1]=c*h;b[2]=d*h;b[3]=f*h;return b};s.add=function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+= -b[3],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];e[3]=a[3]+b[3];return e};s.multiply=function(a,b,e){e||(e=a);var c=a[0],d=a[1],f=a[2];a=a[3];var h=b[0],g=b[1],j=b[2];b=b[3];e[0]=c*b+a*h+d*j-f*g;e[1]=d*b+a*g+f*h-c*j;e[2]=f*b+a*j+c*g-d*h;e[3]=a*b-c*h-d*g-f*j;return e};s.multiplyVec3=function(a,b,e){e||(e=b);var c=b[0],d=b[1],f=b[2];b=a[0];var h=a[1],g=a[2];a=a[3];var j=a*c+h*f-g*d,l=a*d+g*c-b*f,m=a*f+b*d-h*c,c=-b*c-h*d-g*f;e[0]=j*a+c*-b+l*-g-m*-h;e[1]=l*a+c*-h+m*-b-j*-g;e[2]=m*a+c*-g+j*-h-l*-b; -return e};s.scale=function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a[3]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;e[3]=a[3]*b;return e};s.toMat3=function(a,b){b||(b=F.create());var e=a[0],c=a[1],d=a[2],f=a[3],h=e+e,g=c+c,j=d+d,l=e*h,m=e*g,e=e*j,n=c*g,c=c*j,d=d*j,h=f*h,g=f*g,f=f*j;b[0]=1-(n+d);b[1]=m+f;b[2]=e-g;b[3]=m-f;b[4]=1-(l+d);b[5]=c+h;b[6]=e+g;b[7]=c-h;b[8]=1-(l+n);return b};s.toMat4=function(a,b){b||(b=y.create());var e=a[0],c=a[1],d=a[2],f=a[3],g=e+e,j=c+c,l=d+d,m=e*g,n=e*j,e=e* -l,p=c*j,c=c*l,d=d*l,g=f*g,j=f*j,f=f*l;b[0]=1-(p+d);b[1]=n+f;b[2]=e-j;b[3]=0;b[4]=n-f;b[5]=1-(m+d);b[6]=c+g;b[7]=0;b[8]=e+j;b[9]=c-g;b[10]=1-(m+p);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};s.slerp=function(a,b,c,d){d||(d=a);var f=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],g,h;if(1<=Math.abs(f))return d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d;g=Math.acos(f);h=Math.sqrt(1-f*f);if(0.001>Math.abs(h))return d[0]=0.5*a[0]+0.5*b[0],d[1]=0.5*a[1]+0.5*b[1],d[2]=0.5*a[2]+0.5*b[2],d[3]=0.5*a[3]+ -0.5*b[3],d;f=Math.sin((1-c)*g)/h;c=Math.sin(c*g)/h;d[0]=a[0]*f+b[0]*c;d[1]=a[1]*f+b[1]*c;d[2]=a[2]*f+b[2]*c;d[3]=a[3]*f+b[3]*c;return d};s.fromRotationMatrix=function(a,b){b||(b=s.create());var c=a[0]+a[4]+a[8],d;if(0a[0]&&(c=1);a[8]>a[3*c+c]&&(c=2);var f=d[c],g=d[f];d=Math.sqrt(a[3*c+c]-a[3*f+f]-a[3*g+g]+1);b[c]=0.5*d;d= -0.5/d;b[3]=(a[3*g+f]-a[3*f+g])*d;b[f]=(a[3*f+c]+a[3*c+f])*d;b[g]=(a[3*g+c]+a[3*c+g])*d}return b};F.toQuat4=s.fromRotationMatrix;var D=F.create();s.fromAxes=function(a,b,c,d){D[0]=b[0];D[3]=b[1];D[6]=b[2];D[1]=c[0];D[4]=c[1];D[7]=c[2];D[2]=a[0];D[5]=a[1];D[8]=a[2];return s.fromRotationMatrix(D,d)};s.identity=function(a){a||(a=s.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};s.fromAngleAxis=function(a,b,c){c||(c=s.create());a*=0.5;var d=Math.sin(a);c[3]=Math.cos(a);c[0]=d*b[0];c[1]=d*b[1];c[2]=d*b[2]; -return c};s.toAngleAxis=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); -b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 -Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],f=a[2],g=a[3],h=c*g-f*d;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-d*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, -b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];c[0]=d*b[0]+f*b[2];c[1]=d*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=d*b+f*h;c[1]=d*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var d=b[0];b=b[1];c[0]=d*a[0]+b*a[1];c[1]=d*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var d=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=d*b;c[2]=f*h;c[3]= -g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,d){var f=new l(4);f[0]=a;f[1]=b;f[2]=c;f[3]=d;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, -b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| -(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)},squaredLength:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};c&&(c.glMatrixArrayType=l,c.MatrixArray=l,c.setMatrixArrayType=d,c.determineMatrixArrayType= -f,c.glMath=g,c.vec2=M,c.vec3=j,c.vec4=N,c.mat2=L,c.mat3=F,c.mat4=y,c.quat4=s);return{glMatrixArrayType:l,MatrixArray:l,setMatrixArrayType:d,determineMatrixArrayType:f,glMath:g,vec2:M,vec3:j,vec4:N,mat2:L,mat3:F,mat4:y,quat4:s}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * vColor;","}"]; -PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"]; -PIXI.CompileVertexShader=function(c,d){for(var f="",g=0;g 0) { - this.checkVisibility(child); + this.checkVisibility(child, actualVisibility); } + + }; } -/** - * @private - */ -PIXI.WebGLRenderer.prototype.setGLVisible = function(displayObject, visibility) -{ - var children = displayObject.children; - - for (var i=0; i < children.length; i++) - { - var child = children[i]; - - if(visibility) - { - this.addDisplayObject(child); - } - else - { - this.removeDisplayObject(child); - } - - if(child.children.length > 0) - { - this.setGLVisible(child, visibility); - } - } - -} - /** * Renders the stage to its webGL view - * @param the PIXI.Stage element to be rendered + * @method render + * @param stage {Stage} the PIXI.Stage element to be rendered */ PIXI.WebGLRenderer.prototype.render = function(stage) { @@ -185,9 +164,18 @@ // update children if need be // best to remove first! - for (var i=0; i < stage.__childrenRemoved.length; i++) this.removeDisplayObject(stage.__childrenRemoved[i]); + for (var i=0; i < stage.__childrenRemoved.length; i++) + { + this.removeDisplayObject(stage.__childrenRemoved[i]); + // stage.__childrenRemoved[i].cacheVisible = false; + } + /* // no add all new sprites - for (var i=0; i < stage.__childrenAdded.length; i++) this.addDisplayObject(stage.__childrenAdded[i]); + for (var i=0; i < stage.__childrenAdded.length; i++) + { + stage.__childrenAdded[i].cacheVisible = false; +// this.addDisplayObject(stage.__childrenAdded[i]); + }*/ // update any textures for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]); @@ -197,7 +185,7 @@ PIXI.texturesToUpdate = []; // recursivly loop through all items! - this.checkVisibility(stage); + this.checkVisibility(stage, true); // update the scen graph stage.updateTransform(); @@ -206,7 +194,7 @@ gl.clear(gl.COLOR_BUFFER_BIT) - gl.clearColor(1, 1, 1, 1.0); + gl.clearColor(0, 0, 0, 1.0); // set the correct blend mode! gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); @@ -265,12 +253,16 @@ */ PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject) { - if(!displayObject.stage)return; - displayObject.cacheVisible = displayObject.visible; + if(!displayObject.stage)return; // means it was removed + if(displayObject.__inWebGL)return; //means it is already in webgL - if(!displayObject.visible)return; + //displayObject.cacheVisible = displayObject.visible; + + // TODO if objects parent is not visible then dont add to stage!!!! + //if(!displayObject.visible)return; + displayObject.batch = null; //displayObject.cacheVisible = true; @@ -458,10 +450,12 @@ PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject) { //if(displayObject.stage)return; - displayObject.cacheVisible = displayObject.visible; + displayObject.cacheVisible = false;//displayObject.visible; if(!displayObject.renderable)return; + displayObject.__inWebGL = false; + /* * removing is a lot quicker.. * @@ -472,9 +466,11 @@ { // should always have a batch! var batch = displayObject.batch; - if(!batch)return; // thismeans the display list has been altered befre rendering + if(!batch)return; // this means the display list has been altered befre rendering batch.remove(displayObject); + + if(batch.size==0) { batchToRemove = batch @@ -528,8 +524,9 @@ /** * resizes the webGL view to the specified width and height - * @param the new width of the webGL view - * @param the new height of the webGL view + * @method resize + * @param width {Number} the new width of the webGL view + * @param height {Number} the new height of the webGL view */ PIXI.WebGLRenderer.prototype.resize = function(width, height) { diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/examples/bunny benchmark/index.html b/examples/bunny benchmark/index.html index 7c5521b..95972c4 100644 --- a/examples/bunny benchmark/index.html +++ b/examples/bunny benchmark/index.html @@ -9,9 +9,10 @@ +
    Click to add more bunnys! Let me know how many you get on screen here @doormat23
    - + diff --git a/examples/bunny benchmark/js/bunnyBenchMark.js b/examples/bunny benchmark/js/bunnyBenchMark.js index a3154eb..c3c8ec5 100644 --- a/examples/bunny benchmark/js/bunnyBenchMark.js +++ b/examples/bunny benchmark/js/bunnyBenchMark.js @@ -22,18 +22,13 @@ var count = 0; var container; +var detail; + function onReady() { - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() + detail = document.getElementById("pixi"); - if(webgl) - { - renderer = new PIXI.WebGLRenderer(); - } - else - { - renderer = new PIXI.CanvasRenderer(480, 320); - } + renderer = PIXI.autoDetectRenderer(); stage = new PIXI.Stage; @@ -46,7 +41,7 @@ stats.domElement.style.top = "0px"; requestAnimFrame(update); - wabbitTexture = new PIXI.Texture("wabbit.png") + wabbitTexture = new PIXI.Texture.fromImage("wabbit.png") counter = document.createElement("div"); counter.className = "counter"; @@ -55,7 +50,6 @@ count = startBunnyCount; counter.innerHTML = count + " BUNNIES"; - container = new PIXI.DisplayObjectContainer(); stage.addChild(container); @@ -114,7 +108,9 @@ minX = 0; maxY = height; minY = 0; - + + detail.style.left = width - 204 + "px"; + detail.style.top = height - 100 + "px"; renderer.resize(width, height); } @@ -126,17 +122,17 @@ { // add 10 at a time :) - for (var i = 0; i < 2; i++) + for (var i = 0; i < 10; i++) { - var bunny = new PIXI.Sprite(wabbitTexture, {x:0, y:0, width:26, height:37}); + var bunny = new PIXI.Sprite(wabbitTexture); bunny.speedX = Math.random() * 10; bunny.speedY = (Math.random() * 10) - 5; bunny.anchor.x = 0.5; bunny.anchor.y = 1; - bunny.alpha = 0.3 + Math.random() * 0.7; + //bunny.alpha = 0.3 + Math.random() * 0.7; bunnys.push(bunny); - bunny.rotation = Math.random() - 0.5; + //bunny.rotation = Math.random() - 0.5; container.addChild(bunny); count++; diff --git a/examples/bunny benchmark/js/pixi.js b/examples/bunny benchmark/js/pixi.js new file mode 100644 index 0000000..65add09 --- /dev/null +++ b/examples/bunny benchmark/js/pixi.js @@ -0,0 +1,110 @@ +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, +d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* +j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= +a[0]-d[0],c=a[1]-d[1];a=a[2]-d[2];d=Math.sqrt(b*b+c*c+a*a);if(!d)return j[0]=0,j[1]=0,j[2]=0,j;d=1/d;j[0]=b*d;j[1]=c*d;j[2]=a*d;return j},lerp:function(a,d,j,b){b||(b=a);b[0]=a[0]+j*(d[0]-a[0]);b[1]=a[1]+j*(d[1]-a[1]);b[2]=a[2]+j*(d[2]-a[2]);return b},dist:function(a,d){var j=d[0]-a[0],b=d[1]-a[1],c=d[2]-a[2];return Math.sqrt(j*j+b*b+c*c)}},p=null,q=new k(4);l.unproject=function(a,d,j,b,c){c||(c=a);p||(p=t.create());var e=p;q[0]=2*(a[0]-b[0])/b[2]-1;q[1]=2*(a[1]-b[1])/b[3]-1;q[2]=2*a[2]-1;q[3]=1; +t.multiply(j,d,e);if(!t.inverse(e))return null;t.multiplyVec4(e,q);if(0===q[3])return null;c[0]=q[0]/q[3];c[1]=q[1]/q[3];c[2]=q[2]/q[3];return c};var C=l.createFrom(1,0,0),F=l.createFrom(0,1,0),u=l.createFrom(0,0,1),w=l.create();l.rotationTo=function(a,d,j){j||(j=m.create());var b=l.dot(a,d);if(1<=b)m.set(H,j);else if(-0.999999>b)l.cross(C,a,w),1E-6>l.length(w)&&l.cross(F,a,w),1E-6>l.length(w)&&l.cross(u,a,w),l.normalize(w),m.fromAngleAxis(Math.PI,w,j);else{var b=Math.sqrt(2*(1+b)),c=1/b;l.cross(a, +d,w);j[0]=w[0]*c;j[1]=w[1]*c;j[2]=w[2]*c;j[3]=0.5*b;m.normalize(j)}1j[3]&&(j[3]=-1);return j};l.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var x={create:function(a){var d=new k(9);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8]):d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=0;return d},createFrom:function(a,d,j,b,c,e,n,f,E){var s=new k(9);s[0]=a;s[1]=d;s[2]=j;s[3]=b;s[4]=c;s[5]=e;s[6]=n;s[7]=f;s[8]=E;return s},determinant:function(a){var d= +a[3],j=a[4],b=a[5],c=a[6],e=a[7],n=a[8];return a[0]*(n*j-b*e)+a[1]*(-n*d+b*c)+a[2]*(e*d-j*c)},inverse:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[3],n=a[4],f=a[5],E=a[6],s=a[7],I=a[8],g=I*n-f*s,h=-I*e+f*E,k=s*e-n*E,r=j*g+b*h+c*k;if(!r)return null;r=1/r;d||(d=x.create());d[0]=g*r;d[1]=(-I*b+c*s)*r;d[2]=(f*b-c*n)*r;d[3]=h*r;d[4]=(I*j-c*E)*r;d[5]=(-f*j+c*e)*r;d[6]=k*r;d[7]=(-s*j+b*E)*r;d[8]=(n*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],D=a[4],E=a[5],s=a[6],I= +a[7];a=a[8];var g=d[0],h=d[1],k=d[2],r=d[3],m=d[4],l=d[5],q=d[6],v=d[7];d=d[8];j[0]=g*b+h*f+k*s;j[1]=g*c+h*D+k*I;j[2]=g*e+h*E+k*a;j[3]=r*b+m*f+l*s;j[4]=r*c+m*D+l*I;j[5]=r*e+m*E+l*a;j[6]=q*b+v*f+d*s;j[7]=q*c+v*D+d*I;j[8]=q*e+v*E+d*a;return j},multiplyVec2:function(a,d,j){j||(j=d);var b=d[0];d=d[1];j[0]=b*a[0]+d*a[3]+a[6];j[1]=b*a[1]+d*a[4]+a[7];return j},multiplyVec3:function(a,d,j){j||(j=d);var b=d[0],c=d[1];d=d[2];j[0]=b*a[0]+c*a[3]+d*a[6];j[1]=b*a[1]+c*a[4]+d*a[7];j[2]=b*a[2]+c*a[5]+d*a[8];return j}, +set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])},identity:function(a){a||(a=x.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, +d){if(!d||a===d){var j=a[1],b=a[2],c=a[5];a[1]=a[3];a[2]=a[6];a[3]=j;a[5]=a[7];a[6]=b;a[7]=c;return a}d[0]=a[0];d[1]=a[3];d[2]=a[6];d[3]=a[1];d[4]=a[4];d[5]=a[7];d[6]=a[2];d[7]=a[5];d[8]=a[8];return d},toMat4:function(a,d){d||(d=t.create());d[15]=1;d[14]=0;d[13]=0;d[12]=0;d[11]=0;d[10]=a[8];d[9]=a[7];d[8]=a[6];d[7]=0;d[6]=a[5];d[5]=a[4];d[4]=a[3];d[3]=0;d[2]=a[2];d[1]=a[1];d[0]=a[0];return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ +a[8]+"]"}},t={create:function(a){var d=new k(16);a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8],d[9]=a[9],d[10]=a[10],d[11]=a[11],d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d},createFrom:function(a,d,j,b,c,e,f,D,E,s,g,h,m,l,r,q){var A=new k(16);A[0]=a;A[1]=d;A[2]=j;A[3]=b;A[4]=c;A[5]=e;A[6]=f;A[7]=D;A[8]=E;A[9]=s;A[10]=g;A[11]=h;A[12]=m;A[13]=l;A[14]=r;A[15]=q;return A},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4]; +d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=a[12];d[13]=a[13];d[14]=a[14];d[15]=a[15];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])&&1E-6>Math.abs(a[9]-d[9])&&1E-6>Math.abs(a[10]-d[10])&&1E-6>Math.abs(a[11]-d[11])&&1E-6>Math.abs(a[12]- +d[12])&&1E-6>Math.abs(a[13]-d[13])&&1E-6>Math.abs(a[14]-d[14])&&1E-6>Math.abs(a[15]-d[15])},identity:function(a){a||(a=t.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,d){if(!d||a===d){var j=a[1],b=a[2],c=a[3],e=a[6],f=a[7],D=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=j;a[6]=a[9];a[7]=a[13];a[8]=b;a[9]=e;a[11]=a[14];a[12]=c;a[13]=f;a[14]=D;return a}d[0]=a[0];d[1]=a[4];d[2]=a[8];d[3]=a[12]; +d[4]=a[1];d[5]=a[5];d[6]=a[9];d[7]=a[13];d[8]=a[2];d[9]=a[6];d[10]=a[10];d[11]=a[14];d[12]=a[3];d[13]=a[7];d[14]=a[11];d[15]=a[15];return d},determinant:function(a){var d=a[0],j=a[1],b=a[2],c=a[3],e=a[4],f=a[5],D=a[6],E=a[7],s=a[8],g=a[9],h=a[10],k=a[11],m=a[12],r=a[13],l=a[14];a=a[15];return m*g*D*c-s*r*D*c-m*f*h*c+e*r*h*c+s*f*l*c-e*g*l*c-m*g*b*E+s*r*b*E+m*j*h*E-d*r*h*E-s*j*l*E+d*g*l*E+m*f*b*k-e*r*b*k-m*j*D*k+d*r*D*k+e*j*l*k-d*f*l*k-s*f*b*a+e*g*b*a+s*j*D*a-d*g*D*a-e*j*h*a+d*f*h*a},inverse:function(a, +d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=a[3],f=a[4],D=a[5],E=a[6],s=a[7],g=a[8],h=a[9],k=a[10],m=a[11],r=a[12],l=a[13],A=a[14],q=a[15],v=j*D-b*f,J=j*E-c*f,y=j*s-e*f,z=b*E-c*D,t=b*s-e*D,u=c*s-e*E,p=g*l-h*r,w=g*A-k*r,x=g*q-m*r,B=h*A-k*l,C=h*q-m*l,F=k*q-m*A,G=v*F-J*C+y*B+z*x-t*w+u*p;if(!G)return null;G=1/G;d[0]=(D*F-E*C+s*B)*G;d[1]=(-b*F+c*C-e*B)*G;d[2]=(l*u-A*t+q*z)*G;d[3]=(-h*u+k*t-m*z)*G;d[4]=(-f*F+E*x-s*w)*G;d[5]=(j*F-c*x+e*w)*G;d[6]=(-r*u+A*y-q*J)*G;d[7]=(g*u-k*y+m*J)*G;d[8]=(f*C-D*x+s*p)*G;d[9]= +(-j*C+b*x-e*p)*G;d[10]=(r*t-l*y+q*v)*G;d[11]=(-g*t+h*y-m*v)*G;d[12]=(-f*B+D*w-E*p)*G;d[13]=(j*B-b*w+c*p)*G;d[14]=(-r*z+l*J-A*v)*G;d[15]=(g*z-h*J+k*v)*G;return d},toRotationMat:function(a,d){d||(d=t.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d},toMat3:function(a,d){d||(d=x.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[4];d[4]=a[5];d[5]=a[6];d[6]=a[8];d[7]=a[9];d[8]=a[10]; +return d},toInverseMat3:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[4],f=a[5],D=a[6],g=a[8],s=a[9],h=a[10],k=h*f-D*s,m=-h*e+D*g,l=s*e-f*g,r=j*k+b*m+c*l;if(!r)return null;r=1/r;d||(d=x.create());d[0]=k*r;d[1]=(-h*b+c*s)*r;d[2]=(D*b-c*f)*r;d[3]=m*r;d[4]=(h*j-c*g)*r;d[5]=(-D*j+c*e)*r;d[6]=l*r;d[7]=(-s*j+b*g)*r;d[8]=(f*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],s=a[6],k=a[7],m=a[8],l=a[9],q=a[10],r=a[11],t=a[12],A=a[13],u=a[14];a=a[15];var v=d[0], +p=d[1],y=d[2],z=d[3];j[0]=v*b+p*g+y*m+z*t;j[1]=v*c+p*h+y*l+z*A;j[2]=v*e+p*s+y*q+z*u;j[3]=v*f+p*k+y*r+z*a;v=d[4];p=d[5];y=d[6];z=d[7];j[4]=v*b+p*g+y*m+z*t;j[5]=v*c+p*h+y*l+z*A;j[6]=v*e+p*s+y*q+z*u;j[7]=v*f+p*k+y*r+z*a;v=d[8];p=d[9];y=d[10];z=d[11];j[8]=v*b+p*g+y*m+z*t;j[9]=v*c+p*h+y*l+z*A;j[10]=v*e+p*s+y*q+z*u;j[11]=v*f+p*k+y*r+z*a;v=d[12];p=d[13];y=d[14];z=d[15];j[12]=v*b+p*g+y*m+z*t;j[13]=v*c+p*h+y*l+z*A;j[14]=v*e+p*s+y*q+z*u;j[15]=v*f+p*k+y*r+z*a;return j},multiplyVec3:function(a,d,b){b||(b=d); +var c=d[0],e=d[1];d=d[2];b[0]=a[0]*c+a[4]*e+a[8]*d+a[12];b[1]=a[1]*c+a[5]*e+a[9]*d+a[13];b[2]=a[2]*c+a[6]*e+a[10]*d+a[14];return b},multiplyVec4:function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=d[3];b[0]=a[0]*c+a[4]*e+a[8]*f+a[12]*d;b[1]=a[1]*c+a[5]*e+a[9]*f+a[13]*d;b[2]=a[2]*c+a[6]*e+a[10]*f+a[14]*d;b[3]=a[3]*c+a[7]*e+a[11]*f+a[15]*d;return b},translate:function(a,d,b){var c=d[0],e=d[1];d=d[2];var f,n,g,h,s,k,m,l,p,r,q,t;if(!b||a===b)return a[12]=a[0]*c+a[4]*e+a[8]*d+a[12],a[13]=a[1]*c+a[5]*e+ +a[9]*d+a[13],a[14]=a[2]*c+a[6]*e+a[10]*d+a[14],a[15]=a[3]*c+a[7]*e+a[11]*d+a[15],a;f=a[0];n=a[1];g=a[2];h=a[3];s=a[4];k=a[5];m=a[6];l=a[7];p=a[8];r=a[9];q=a[10];t=a[11];b[0]=f;b[1]=n;b[2]=g;b[3]=h;b[4]=s;b[5]=k;b[6]=m;b[7]=l;b[8]=p;b[9]=r;b[10]=q;b[11]=t;b[12]=f*c+s*e+p*d+a[12];b[13]=n*c+k*e+r*d+a[13];b[14]=g*c+m*e+q*d+a[14];b[15]=h*c+l*e+t*d+a[15];return b},scale:function(a,d,b){var c=d[0],e=d[1];d=d[2];if(!b||a===b)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=d,a[9]*= +d,a[10]*=d,a[11]*=d,a;b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[7]=a[7]*e;b[8]=a[8]*d;b[9]=a[9]*d;b[10]=a[10]*d;b[11]=a[11]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},rotate:function(a,d,b,c){var e=b[0],f=b[1];b=b[2];var n=Math.sqrt(e*e+f*f+b*b),g,h,k,m,l,p,q,r,t,u,w,v,x,y,z,B,C,F,H,K;if(!n)return null;1!==n&&(n=1/n,e*=n,f*=n,b*=n);g=Math.sin(d);h=Math.cos(d);k=1-h;d=a[0];n=a[1];m=a[2];l=a[3];p=a[4];q=a[5];r=a[6];t=a[7];u=a[8];w=a[9];v= +a[10];x=a[11];y=e*e*k+h;z=f*e*k+b*g;B=b*e*k-f*g;C=e*f*k-b*g;F=f*f*k+h;H=b*f*k+e*g;K=e*b*k+f*g;e=f*b*k-e*g;f=b*b*k+h;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=d*y+p*z+u*B;c[1]=n*y+q*z+w*B;c[2]=m*y+r*z+v*B;c[3]=l*y+t*z+x*B;c[4]=d*C+p*F+u*H;c[5]=n*C+q*F+w*H;c[6]=m*C+r*F+v*H;c[7]=l*C+t*F+x*H;c[8]=d*K+p*e+u*f;c[9]=n*K+q*e+w*f;c[10]=m*K+r*e+v*f;c[11]=l*K+t*e+x*f;return c},rotateX:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[4],f=a[5],n=a[6],g=a[7],h=a[8],k=a[9],m=a[10], +l=a[11];b?a!==b&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[4]=e*d+h*c;b[5]=f*d+k*c;b[6]=n*d+m*c;b[7]=g*d+l*c;b[8]=e*-c+h*d;b[9]=f*-c+k*d;b[10]=n*-c+m*d;b[11]=g*-c+l*d;return b},rotateY:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[8],k=a[9],m=a[10],l=a[11];b?a!==b&&(b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*-c;b[1]=f*d+k*-c;b[2]=n*d+m*-c;b[3]=g* +d+l*-c;b[8]=e*c+h*d;b[9]=f*c+k*d;b[10]=n*c+m*d;b[11]=g*c+l*d;return b},rotateZ:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[4],k=a[5],m=a[6],l=a[7];b?a!==b&&(b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*c;b[1]=f*d+k*c;b[2]=n*d+m*c;b[3]=g*d+l*c;b[4]=e*-c+h*d;b[5]=f*-c+k*d;b[6]=n*-c+m*d;b[7]=g*-c+l*d;return b},frustum:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2*e/g;n[1]=0; +n[2]=0;n[3]=0;n[4]=0;n[5]=2*e/h;n[6]=0;n[7]=0;n[8]=(d+a)/g;n[9]=(c+b)/h;n[10]=-(f+e)/k;n[11]=-1;n[12]=0;n[13]=0;n[14]=-(2*f*e)/k;n[15]=0;return n},perspective:function(a,d,b,c,e){a=b*Math.tan(a*Math.PI/360);d*=a;return t.frustum(-d,d,-a,a,b,c,e)},ortho:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2/g;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=2/h;n[6]=0;n[7]=0;n[8]=0;n[9]=0;n[10]=-2/k;n[11]=0;n[12]=-(a+d)/g;n[13]=-(c+b)/h;n[14]=-(f+e)/k;n[15]=1;return n},lookAt:function(a,d,b,c){c|| +(c=t.create());var e,f,n,g,h,k,m,l,p=a[0],q=a[1];a=a[2];n=b[0];g=b[1];f=b[2];m=d[0];b=d[1];e=d[2];if(p===m&&q===b&&a===e)return t.identity(c);d=p-m;b=q-b;m=a-e;l=1/Math.sqrt(d*d+b*b+m*m);d*=l;b*=l;m*=l;e=g*m-f*b;f=f*d-n*m;n=n*b-g*d;(l=Math.sqrt(e*e+f*f+n*n))?(l=1/l,e*=l,f*=l,n*=l):n=f=e=0;g=b*n-m*f;h=m*e-d*n;k=d*f-b*e;(l=Math.sqrt(g*g+h*h+k*k))?(l=1/l,g*=l,h*=l,k*=l):k=h=g=0;c[0]=e;c[1]=g;c[2]=d;c[3]=0;c[4]=f;c[5]=h;c[6]=b;c[7]=0;c[8]=n;c[9]=k;c[10]=m;c[11]=0;c[12]=-(e*p+f*q+n*a);c[13]=-(g*p+h*q+ +k*a);c[14]=-(d*p+b*q+m*a);c[15]=1;return c},fromRotationTranslation:function(a,d,b){b||(b=t.create());var c=a[0],e=a[1],f=a[2],n=a[3],g=c+c,h=e+e,k=f+f;a=c*g;var l=c*h,c=c*k,m=e*h,e=e*k,f=f*k,g=n*g,h=n*h,n=n*k;b[0]=1-(m+f);b[1]=l+n;b[2]=c-h;b[3]=0;b[4]=l-n;b[5]=1-(a+f);b[6]=e+g;b[7]=0;b[8]=c+h;b[9]=e-g;b[10]=1-(a+m);b[11]=0;b[12]=d[0];b[13]=d[1];b[14]=d[2];b[15]=1;return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ +a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},m={create:function(a){var d=new k(4);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]):d[0]=d[1]=d[2]=d[3]=0;return d},createFrom:function(a,d,b,c){var e=new k(4);e[0]=a;e[1]=d;e[2]=b;e[3]=c;return e},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])},identity:function(a){a||(a=m.create()); +a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},H=m.identity();m.calculateW=function(a,d){var b=a[0],c=a[1],e=a[2];if(!d||a===d)return a[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e)),a;d[0]=b;d[1]=c;d[2]=e;d[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e));return d};m.dot=function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3]};m.inverse=function(a,d){var b=a[0],c=a[1],e=a[2],f=a[3],b=(b=b*b+c*c+e*e+f*f)?1/b:0;if(!d||a===d)return a[0]*=-b,a[1]*=-b,a[2]*=-b,a[3]*=b,a;d[0]=-a[0]*b;d[1]=-a[1]*b;d[2]=-a[2]*b;d[3]=a[3]*b; +return d};m.conjugate=function(a,d){if(!d||a===d)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=a[3];return d};m.length=function(a){var d=a[0],b=a[1],c=a[2];a=a[3];return Math.sqrt(d*d+b*b+c*c+a*a)};m.normalize=function(a,d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=Math.sqrt(b*b+c*c+e*e+f*f);if(0===g)return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d;g=1/g;d[0]=b*g;d[1]=c*g;d[2]=e*g;d[3]=f*g;return d};m.add=function(a,d,b){if(!b||a===b)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a[3]+= +d[3],a;b[0]=a[0]+d[0];b[1]=a[1]+d[1];b[2]=a[2]+d[2];b[3]=a[3]+d[3];return b};m.multiply=function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2];a=a[3];var g=d[0],h=d[1],k=d[2];d=d[3];b[0]=c*d+a*g+e*k-f*h;b[1]=e*d+a*h+f*g-c*k;b[2]=f*d+a*k+c*h-e*g;b[3]=a*d-c*g-e*h-f*k;return b};m.multiplyVec3=function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=a[0];var g=a[1],h=a[2];a=a[3];var k=a*c+g*f-h*e,l=a*e+h*c-d*f,m=a*f+d*e-g*c,c=-d*c-g*e-h*f;b[0]=k*a+c*-d+l*-h-m*-g;b[1]=l*a+c*-g+m*-d-k*-h;b[2]=m*a+c*-h+k*-g-l*-d; +return b};m.scale=function(a,d,b){if(!b||a===b)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a;b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[3]=a[3]*d;return b};m.toMat3=function(a,d){d||(d=x.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b*k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=m-f;d[4]=1-(l+e);d[5]=c+g;d[6]=b+h;d[7]=c-g;d[8]=1-(l+p);return d};m.toMat4=function(a,d){d||(d=t.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b* +k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=0;d[4]=m-f;d[5]=1-(l+e);d[6]=c+g;d[7]=0;d[8]=b+h;d[9]=c-g;d[10]=1-(l+p);d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d};m.slerp=function(a,d,b,c){c||(c=a);var e=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3],f,g;if(1<=Math.abs(e))return c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]),c;f=Math.acos(e);g=Math.sqrt(1-e*e);if(0.0010>Math.abs(g))return c[0]=0.5*a[0]+0.5*d[0],c[1]=0.5*a[1]+0.5*d[1],c[2]=0.5*a[2]+0.5*d[2],c[3]=0.5*a[3]+ +0.5*d[3],c;e=Math.sin((1-b)*f)/g;b=Math.sin(b*f)/g;c[0]=a[0]*e+d[0]*b;c[1]=a[1]*e+d[1]*b;c[2]=a[2]*e+d[2]*b;c[3]=a[3]*e+d[3]*b;return c};m.fromRotationMatrix=function(a,d){d||(d=m.create());var b=a[0]+a[4]+a[8],c;if(0a[0]&&(b=1);a[8]>a[3*b+b]&&(b=2);var e=c[b],f=c[e];c=Math.sqrt(a[3*b+b]-a[3*e+e]-a[3*f+f]+1);d[b]=0.5*c;c= +0.5/c;d[3]=(a[3*f+e]-a[3*e+f])*c;d[e]=(a[3*e+b]+a[3*b+e])*c;d[f]=(a[3*f+b]+a[3*b+f])*c}return d};x.toQuat4=m.fromRotationMatrix;var B=x.create();m.fromAxes=function(a,d,b,c){B[0]=d[0];B[3]=d[1];B[6]=d[2];B[1]=b[0];B[4]=b[1];B[7]=b[2];B[2]=a[0];B[5]=a[1];B[8]=a[2];return m.fromRotationMatrix(B,c)};m.identity=function(a){a||(a=m.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};m.fromAngleAxis=function(a,d,b){b||(b=m.create());a*=0.5;var c=Math.sin(a);b[3]=Math.cos(a);b[0]=c*d[0];b[1]=c*d[1];b[2]=c*d[2]; +return b};m.toAngleAxis=function(a,d){d||(d=a);var b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); +b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 +Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],e=a[1],f=a[2],g=a[3],h=c*g-f*e;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-e*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, +b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];c[0]=e*b[0]+f*b[2];c[1]=e*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=e*b+f*h;c[1]=e*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var e=b[0];b=b[1];c[0]=e*a[0]+b*a[1];c[1]=e*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var e=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=e*b;c[2]=f*h;c[3]= +g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, +b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| +(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= +f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; +PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; +PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l>1);var b=m[0];return b*(1.5-0.5*a*b*b)}}else g.invsqrt=function(a){return 1/Math.sqrt(a)}; -var l=null;f();var j={create:function(a){var b=new l(3);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0;return b},createFrom:function(a,b,e){var c=new l(3);c[0]=a;c[1]=b;c[2]=e;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])},add:function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];return e},subtract:function(a, -b,e){if(!e||a===e)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];return e},multiply:function(a,b,e){if(!e||a===e)return a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a;e[0]=a[0]*b[0];e[1]=a[1]*b[1];e[2]=a[2]*b[2];return e},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;return e},normalize:function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=Math.sqrt(e* -e+c*c+d*d);if(!k)return b[0]=0,b[1]=0,b[2]=0,b;if(1===k)return b[0]=e,b[1]=c,b[2]=d,b;k=1/k;b[0]=e*k;b[1]=c*k;b[2]=d*k;return b},cross:function(a,b,e){e||(e=a);var c=a[0],d=a[1];a=a[2];var k=b[0],h=b[1];b=b[2];e[0]=d*b-a*h;e[1]=a*k-c*b;e[2]=c*h-d*k;return e},length:function(a){var b=a[0],e=a[1];a=a[2];return Math.sqrt(b*b+e*e+a*a)},squaredLength:function(a){var b=a[0],e=a[1];a=a[2];return b*b+e*e+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,b,e){e||(e=a);var c= -a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];b=Math.sqrt(c*c+d*d+a*a);if(!b)return e[0]=0,e[1]=0,e[2]=0,e;b=1/b;e[0]=c*b;e[1]=d*b;e[2]=a*b;return e},lerp:function(a,b,e,c){c||(c=a);c[0]=a[0]+e*(b[0]-a[0]);c[1]=a[1]+e*(b[1]-a[1]);c[2]=a[2]+e*(b[2]-a[2]);return c},dist:function(a,b){var e=b[0]-a[0],c=b[1]-a[1],d=b[2]-a[2];return Math.sqrt(e*e+c*c+d*d)}},x=null,n=new l(4);j.unproject=function(a,b,e,c,d){d||(d=a);x||(x=y.create());var k=x;n[0]=2*(a[0]-c[0])/c[2]-1;n[1]=2*(a[1]-c[1])/c[3]-1;n[2]=2*a[2]-1;n[3]=1; -y.multiply(e,b,k);if(!y.inverse(k))return null;y.multiplyVec4(k,n);if(0===n[3])return null;d[0]=n[0]/n[3];d[1]=n[1]/n[3];d[2]=n[2]/n[3];return d};var z=j.createFrom(1,0,0),A=j.createFrom(0,1,0),H=j.createFrom(0,0,1),C=j.create();j.rotationTo=function(a,b,e){e||(e=s.create());var c=j.dot(a,b);if(1<=c)s.set(O,e);else if(-0.999999>c)j.cross(z,a,C),1E-6>j.length(C)&&j.cross(A,a,C),1E-6>j.length(C)&&j.cross(H,a,C),j.normalize(C),s.fromAngleAxis(Math.PI,C,e);else{var c=Math.sqrt(2*(1+c)),d=1/c;j.cross(a, -b,C);e[0]=C[0]*d;e[1]=C[1]*d;e[2]=C[2]*d;e[3]=0.5*c;s.normalize(e)}1e[3]&&(e[3]=-1);return e};j.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var F={create:function(a){var b=new l(9);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0;return b},createFrom:function(a,b,e,c,d,k,h,E,K){var q=new l(9);q[0]=a;q[1]=b;q[2]=e;q[3]=c;q[4]=d;q[5]=k;q[6]=h;q[7]=E;q[8]=K;return q},determinant:function(a){var b= -a[3],e=a[4],c=a[5],d=a[6],k=a[7],h=a[8];return a[0]*(h*e-c*k)+a[1]*(-h*b+c*d)+a[2]*(k*b-e*d)},inverse:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],E=a[5],K=a[6],q=a[7],f=a[8],g=f*h-E*q,j=-f*k+E*K,J=q*k-h*K,r=e*g+c*j+d*J;if(!r)return null;r=1/r;b||(b=F.create());b[0]=g*r;b[1]=(-f*c+d*q)*r;b[2]=(E*c-d*h)*r;b[3]=j*r;b[4]=(f*e-d*K)*r;b[5]=(-E*e+d*k)*r;b[6]=J*r;b[7]=(-q*e+c*K)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],E=a[4],f=a[5],q=a[6],g= -a[7];a=a[8];var u=b[0],j=b[1],J=b[2],r=b[3],l=b[4],t=b[5],m=b[6],p=b[7];b=b[8];e[0]=u*c+j*h+J*q;e[1]=u*d+j*E+J*g;e[2]=u*k+j*f+J*a;e[3]=r*c+l*h+t*q;e[4]=r*d+l*E+t*g;e[5]=r*k+l*f+t*a;e[6]=m*c+p*h+b*q;e[7]=m*d+p*E+b*g;e[8]=m*k+p*f+b*a;return e},multiplyVec2:function(a,b,e){e||(e=b);var c=b[0];b=b[1];e[0]=c*a[0]+b*a[3]+a[6];e[1]=c*a[1]+b*a[4]+a[7];return e},multiplyVec3:function(a,b,e){e||(e=b);var c=b[0],d=b[1];b=b[2];e[0]=c*a[0]+d*a[3]+b*a[6];e[1]=c*a[1]+d*a[4]+b*a[7];e[2]=c*a[2]+d*a[5]+b*a[8];return e}, -set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])},identity:function(a){a||(a=F.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, -b){if(!b||a===b){var e=a[1],c=a[2],d=a[5];a[1]=a[3];a[2]=a[6];a[3]=e;a[5]=a[7];a[6]=c;a[7]=d;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]=a[8];return b},toMat4:function(a,b){b||(b=y.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ -a[8]+"]"}},y={create:function(a){var b=new l(16);a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]);return b},createFrom:function(a,b,e,c,d,k,h,E,f,q,g,u,j,J,r,m){var t=new l(16);t[0]=a;t[1]=b;t[2]=e;t[3]=c;t[4]=d;t[5]=k;t[6]=h;t[7]=E;t[8]=f;t[9]=q;t[10]=g;t[11]=u;t[12]=j;t[13]=J;t[14]=r;t[15]=m;return t},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4]; -b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])&&1E-6>Math.abs(a[9]-b[9])&&1E-6>Math.abs(a[10]-b[10])&&1E-6>Math.abs(a[11]-b[11])&&1E-6>Math.abs(a[12]- -b[12])&&1E-6>Math.abs(a[13]-b[13])&&1E-6>Math.abs(a[14]-b[14])&&1E-6>Math.abs(a[15]-b[15])},identity:function(a){a||(a=y.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){var e=a[1],c=a[2],d=a[3],k=a[6],h=a[7],E=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=e;a[6]=a[9];a[7]=a[13];a[8]=c;a[9]=k;a[11]=a[14];a[12]=d;a[13]=h;a[14]=E;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12]; -b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b=a[0],e=a[1],c=a[2],d=a[3],k=a[4],h=a[5],E=a[6],f=a[7],g=a[8],I=a[9],u=a[10],j=a[11],l=a[12],r=a[13],m=a[14];a=a[15];return l*I*E*d-g*r*E*d-l*h*u*d+k*r*u*d+g*h*m*d-k*I*m*d-l*I*c*f+g*r*c*f+l*e*u*f-b*r*u*f-g*e*m*f+b*I*m*f+l*h*c*j-k*r*c*j-l*e*E*j+b*r*E*j+k*e*m*j-b*h*m*j-g*h*c*a+k*I*c*a+g*e*E*a-b*I*E*a-k*e*u*a+b*h*u*a},inverse:function(a, -b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],f=a[5],g=a[6],q=a[7],I=a[8],u=a[9],j=a[10],l=a[11],r=a[12],m=a[13],t=a[14],p=a[15],s=e*f-c*h,n=e*g-d*h,v=e*q-k*h,w=c*g-d*f,x=c*q-k*f,y=d*q-k*g,z=I*m-u*r,A=I*t-j*r,C=I*p-l*r,D=u*t-j*m,F=u*p-l*m,H=j*p-l*t,G=s*H-n*F+v*D+w*C-x*A+y*z;if(!G)return null;G=1/G;b[0]=(f*H-g*F+q*D)*G;b[1]=(-c*H+d*F-k*D)*G;b[2]=(m*y-t*x+p*w)*G;b[3]=(-u*y+j*x-l*w)*G;b[4]=(-h*H+g*C-q*A)*G;b[5]=(e*H-d*C+k*A)*G;b[6]=(-r*y+t*v-p*n)*G;b[7]=(I*y-j*v+l*n)*G;b[8]=(h*F-f*C+q*z)*G;b[9]= -(-e*F+c*C-k*z)*G;b[10]=(r*x-m*v+p*s)*G;b[11]=(-I*x+u*v-l*s)*G;b[12]=(-h*D+f*A-g*z)*G;b[13]=(e*D-c*A+d*z)*G;b[14]=(-r*w+m*n-t*s)*G;b[15]=(I*w-u*n+j*s)*G;return b},toRotationMat:function(a,b){b||(b=y.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=F.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10]; -return b},toInverseMat3:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[4],h=a[5],f=a[6],g=a[8],q=a[9],j=a[10],u=j*h-f*q,l=-j*k+f*g,m=q*k-h*g,r=e*u+c*l+d*m;if(!r)return null;r=1/r;b||(b=F.create());b[0]=u*r;b[1]=(-j*c+d*q)*r;b[2]=(f*c-d*h)*r;b[3]=l*r;b[4]=(j*e-d*g)*r;b[5]=(-f*e+d*k)*r;b[6]=m*r;b[7]=(-q*e+c*g)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],f=a[4],g=a[5],q=a[6],j=a[7],u=a[8],l=a[9],m=a[10],r=a[11],p=a[12],t=a[13],s=a[14];a=a[15];var n=b[0], -B=b[1],v=b[2],w=b[3];e[0]=n*c+B*f+v*u+w*p;e[1]=n*d+B*g+v*l+w*t;e[2]=n*k+B*q+v*m+w*s;e[3]=n*h+B*j+v*r+w*a;n=b[4];B=b[5];v=b[6];w=b[7];e[4]=n*c+B*f+v*u+w*p;e[5]=n*d+B*g+v*l+w*t;e[6]=n*k+B*q+v*m+w*s;e[7]=n*h+B*j+v*r+w*a;n=b[8];B=b[9];v=b[10];w=b[11];e[8]=n*c+B*f+v*u+w*p;e[9]=n*d+B*g+v*l+w*t;e[10]=n*k+B*q+v*m+w*s;e[11]=n*h+B*j+v*r+w*a;n=b[12];B=b[13];v=b[14];w=b[15];e[12]=n*c+B*f+v*u+w*p;e[13]=n*d+B*g+v*l+w*t;e[14]=n*k+B*q+v*m+w*s;e[15]=n*h+B*j+v*r+w*a;return e},multiplyVec3:function(a,b,e){e||(e=b); -var c=b[0],d=b[1];b=b[2];e[0]=a[0]*c+a[4]*d+a[8]*b+a[12];e[1]=a[1]*c+a[5]*d+a[9]*b+a[13];e[2]=a[2]*c+a[6]*d+a[10]*b+a[14];return e},multiplyVec4:function(a,b,e){e||(e=b);var c=b[0],d=b[1],k=b[2];b=b[3];e[0]=a[0]*c+a[4]*d+a[8]*k+a[12]*b;e[1]=a[1]*c+a[5]*d+a[9]*k+a[13]*b;e[2]=a[2]*c+a[6]*d+a[10]*k+a[14]*b;e[3]=a[3]*c+a[7]*d+a[11]*k+a[15]*b;return e},translate:function(a,b,e){var c=b[0],d=b[1];b=b[2];var k,h,f,g,q,j,u,l,m,n,p,s;if(!e||a===e)return a[12]=a[0]*c+a[4]*d+a[8]*b+a[12],a[13]=a[1]*c+a[5]*d+ -a[9]*b+a[13],a[14]=a[2]*c+a[6]*d+a[10]*b+a[14],a[15]=a[3]*c+a[7]*d+a[11]*b+a[15],a;k=a[0];h=a[1];f=a[2];g=a[3];q=a[4];j=a[5];u=a[6];l=a[7];m=a[8];n=a[9];p=a[10];s=a[11];e[0]=k;e[1]=h;e[2]=f;e[3]=g;e[4]=q;e[5]=j;e[6]=u;e[7]=l;e[8]=m;e[9]=n;e[10]=p;e[11]=s;e[12]=k*c+q*d+m*b+a[12];e[13]=h*c+j*d+n*b+a[13];e[14]=f*c+u*d+p*b+a[14];e[15]=g*c+l*d+s*b+a[15];return e},scale:function(a,b,e){var c=b[0],d=b[1];b=b[2];if(!e||a===e)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=d,a[5]*=d,a[6]*=d,a[7]*=d,a[8]*=b,a[9]*= -b,a[10]*=b,a[11]*=b,a;e[0]=a[0]*c;e[1]=a[1]*c;e[2]=a[2]*c;e[3]=a[3]*c;e[4]=a[4]*d;e[5]=a[5]*d;e[6]=a[6]*d;e[7]=a[7]*d;e[8]=a[8]*b;e[9]=a[9]*b;e[10]=a[10]*b;e[11]=a[11]*b;e[12]=a[12];e[13]=a[13];e[14]=a[14];e[15]=a[15];return e},rotate:function(a,b,e,c){var d=e[0],k=e[1];e=e[2];var h=Math.sqrt(d*d+k*k+e*e),f,g,q,j,l,m,n,r,p,s,x,y,B,v,w,z,A,C,D,F;if(!h)return null;1!==h&&(h=1/h,d*=h,k*=h,e*=h);f=Math.sin(b);g=Math.cos(b);q=1-g;b=a[0];h=a[1];j=a[2];l=a[3];m=a[4];n=a[5];r=a[6];p=a[7];s=a[8];x=a[9];y= -a[10];B=a[11];v=d*d*q+g;w=k*d*q+e*f;z=e*d*q-k*f;A=d*k*q-e*f;C=k*k*q+g;D=e*k*q+d*f;F=d*e*q+k*f;d=k*e*q-d*f;k=e*e*q+g;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=b*v+m*w+s*z;c[1]=h*v+n*w+x*z;c[2]=j*v+r*w+y*z;c[3]=l*v+p*w+B*z;c[4]=b*A+m*C+s*D;c[5]=h*A+n*C+x*D;c[6]=j*A+r*C+y*D;c[7]=l*A+p*C+B*D;c[8]=b*F+m*d+s*k;c[9]=h*F+n*d+x*k;c[10]=j*F+r*d+y*k;c[11]=l*F+p*d+B*k;return c},rotateX:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[4],k=a[5],h=a[6],f=a[7],g=a[8],q=a[9],j=a[10], -l=a[11];e?a!==e&&(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[4]=d*b+g*c;e[5]=k*b+q*c;e[6]=h*b+j*c;e[7]=f*b+l*c;e[8]=d*-c+g*b;e[9]=k*-c+q*b;e[10]=h*-c+j*b;e[11]=f*-c+l*b;return e},rotateY:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[8],j=a[9],l=a[10],m=a[11];e?a!==e&&(e[4]=a[4],e[5]=a[5],e[6]=a[6],e[7]=a[7],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*-c;e[1]=k*b+j*-c;e[2]=h*b+l*-c;e[3]=f* -b+m*-c;e[8]=d*c+g*b;e[9]=k*c+j*b;e[10]=h*c+l*b;e[11]=f*c+m*b;return e},rotateZ:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[4],j=a[5],l=a[6],m=a[7];e?a!==e&&(e[8]=a[8],e[9]=a[9],e[10]=a[10],e[11]=a[11],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*c;e[1]=k*b+j*c;e[2]=h*b+l*c;e[3]=f*b+m*c;e[4]=d*-c+g*b;e[5]=k*-c+j*b;e[6]=h*-c+l*b;e[7]=f*-c+m*b;return e},frustum:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2*d/f;h[1]=0; -h[2]=0;h[3]=0;h[4]=0;h[5]=2*d/g;h[6]=0;h[7]=0;h[8]=(b+a)/f;h[9]=(c+e)/g;h[10]=-(k+d)/j;h[11]=-1;h[12]=0;h[13]=0;h[14]=-(2*k*d)/j;h[15]=0;return h},perspective:function(a,b,e,c,d){a=e*Math.tan(a*Math.PI/360);b*=a;return y.frustum(-b,b,-a,a,e,c,d)},ortho:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2/f;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/g;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/j;h[11]=0;h[12]=-(a+b)/f;h[13]=-(c+e)/g;h[14]=-(k+d)/j;h[15]=1;return h},lookAt:function(a,b,e,c){c|| -(c=y.create());var d,k,h,f,g,j,l,m,n=a[0],p=a[1];a=a[2];h=e[0];f=e[1];k=e[2];l=b[0];e=b[1];d=b[2];if(n===l&&p===e&&a===d)return y.identity(c);b=n-l;e=p-e;l=a-d;m=1/Math.sqrt(b*b+e*e+l*l);b*=m;e*=m;l*=m;d=f*l-k*e;k=k*b-h*l;h=h*e-f*b;(m=Math.sqrt(d*d+k*k+h*h))?(m=1/m,d*=m,k*=m,h*=m):h=k=d=0;f=e*h-l*k;g=l*d-b*h;j=b*k-e*d;(m=Math.sqrt(f*f+g*g+j*j))?(m=1/m,f*=m,g*=m,j*=m):j=g=f=0;c[0]=d;c[1]=f;c[2]=b;c[3]=0;c[4]=k;c[5]=g;c[6]=e;c[7]=0;c[8]=h;c[9]=j;c[10]=l;c[11]=0;c[12]=-(d*n+k*p+h*a);c[13]=-(f*n+g*p+ -j*a);c[14]=-(b*n+e*p+l*a);c[15]=1;return c},fromRotationTranslation:function(a,b,e){e||(e=y.create());var c=a[0],d=a[1],k=a[2],h=a[3],f=c+c,g=d+d,j=k+k;a=c*f;var l=c*g,c=c*j,m=d*g,d=d*j,k=k*j,f=h*f,g=h*g,h=h*j;e[0]=1-(m+k);e[1]=l+h;e[2]=c-g;e[3]=0;e[4]=l-h;e[5]=1-(a+k);e[6]=d+f;e[7]=0;e[8]=c+g;e[9]=d-f;e[10]=1-(a+m);e[11]=0;e[12]=b[0];e[13]=b[1];e[14]=b[2];e[15]=1;return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ -a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},s={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,e,c){var d=new l(4);d[0]=a;d[1]=b;d[2]=e;d[3]=c;return d},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=s.create()); -a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},O=s.identity();s.calculateW=function(a,b){var e=a[0],c=a[1],d=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d)),a;b[0]=e;b[1]=c;b[2]=d;b[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d));return b};s.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};s.inverse=function(a,b){var e=a[0],c=a[1],d=a[2],f=a[3],e=(e=e*e+c*c+d*d+f*f)?1/e:0;if(!b||a===b)return a[0]*=-e,a[1]*=-e,a[2]*=-e,a[3]*=e,a;b[0]=-a[0]*e;b[1]=-a[1]*e;b[2]=-a[2]*e;b[3]=a[3]*e; -return b};s.conjugate=function(a,b){if(!b||a===b)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};s.length=function(a){var b=a[0],e=a[1],c=a[2];a=a[3];return Math.sqrt(b*b+e*e+c*c+a*a)};s.normalize=function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],f=a[3],h=Math.sqrt(e*e+c*c+d*d+f*f);if(0===h)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;h=1/h;b[0]=e*h;b[1]=c*h;b[2]=d*h;b[3]=f*h;return b};s.add=function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+= -b[3],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];e[3]=a[3]+b[3];return e};s.multiply=function(a,b,e){e||(e=a);var c=a[0],d=a[1],f=a[2];a=a[3];var h=b[0],g=b[1],j=b[2];b=b[3];e[0]=c*b+a*h+d*j-f*g;e[1]=d*b+a*g+f*h-c*j;e[2]=f*b+a*j+c*g-d*h;e[3]=a*b-c*h-d*g-f*j;return e};s.multiplyVec3=function(a,b,e){e||(e=b);var c=b[0],d=b[1],f=b[2];b=a[0];var h=a[1],g=a[2];a=a[3];var j=a*c+h*f-g*d,l=a*d+g*c-b*f,m=a*f+b*d-h*c,c=-b*c-h*d-g*f;e[0]=j*a+c*-b+l*-g-m*-h;e[1]=l*a+c*-h+m*-b-j*-g;e[2]=m*a+c*-g+j*-h-l*-b; -return e};s.scale=function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a[3]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;e[3]=a[3]*b;return e};s.toMat3=function(a,b){b||(b=F.create());var e=a[0],c=a[1],d=a[2],f=a[3],h=e+e,g=c+c,j=d+d,l=e*h,m=e*g,e=e*j,n=c*g,c=c*j,d=d*j,h=f*h,g=f*g,f=f*j;b[0]=1-(n+d);b[1]=m+f;b[2]=e-g;b[3]=m-f;b[4]=1-(l+d);b[5]=c+h;b[6]=e+g;b[7]=c-h;b[8]=1-(l+n);return b};s.toMat4=function(a,b){b||(b=y.create());var e=a[0],c=a[1],d=a[2],f=a[3],g=e+e,j=c+c,l=d+d,m=e*g,n=e*j,e=e* -l,p=c*j,c=c*l,d=d*l,g=f*g,j=f*j,f=f*l;b[0]=1-(p+d);b[1]=n+f;b[2]=e-j;b[3]=0;b[4]=n-f;b[5]=1-(m+d);b[6]=c+g;b[7]=0;b[8]=e+j;b[9]=c-g;b[10]=1-(m+p);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};s.slerp=function(a,b,c,d){d||(d=a);var f=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],g,h;if(1<=Math.abs(f))return d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d;g=Math.acos(f);h=Math.sqrt(1-f*f);if(0.001>Math.abs(h))return d[0]=0.5*a[0]+0.5*b[0],d[1]=0.5*a[1]+0.5*b[1],d[2]=0.5*a[2]+0.5*b[2],d[3]=0.5*a[3]+ -0.5*b[3],d;f=Math.sin((1-c)*g)/h;c=Math.sin(c*g)/h;d[0]=a[0]*f+b[0]*c;d[1]=a[1]*f+b[1]*c;d[2]=a[2]*f+b[2]*c;d[3]=a[3]*f+b[3]*c;return d};s.fromRotationMatrix=function(a,b){b||(b=s.create());var c=a[0]+a[4]+a[8],d;if(0a[0]&&(c=1);a[8]>a[3*c+c]&&(c=2);var f=d[c],g=d[f];d=Math.sqrt(a[3*c+c]-a[3*f+f]-a[3*g+g]+1);b[c]=0.5*d;d= -0.5/d;b[3]=(a[3*g+f]-a[3*f+g])*d;b[f]=(a[3*f+c]+a[3*c+f])*d;b[g]=(a[3*g+c]+a[3*c+g])*d}return b};F.toQuat4=s.fromRotationMatrix;var D=F.create();s.fromAxes=function(a,b,c,d){D[0]=b[0];D[3]=b[1];D[6]=b[2];D[1]=c[0];D[4]=c[1];D[7]=c[2];D[2]=a[0];D[5]=a[1];D[8]=a[2];return s.fromRotationMatrix(D,d)};s.identity=function(a){a||(a=s.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};s.fromAngleAxis=function(a,b,c){c||(c=s.create());a*=0.5;var d=Math.sin(a);c[3]=Math.cos(a);c[0]=d*b[0];c[1]=d*b[1];c[2]=d*b[2]; -return c};s.toAngleAxis=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); -b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 -Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],f=a[2],g=a[3],h=c*g-f*d;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-d*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, -b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];c[0]=d*b[0]+f*b[2];c[1]=d*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=d*b+f*h;c[1]=d*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var d=b[0];b=b[1];c[0]=d*a[0]+b*a[1];c[1]=d*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var d=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=d*b;c[2]=f*h;c[3]= -g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,d){var f=new l(4);f[0]=a;f[1]=b;f[2]=c;f[3]=d;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, -b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| -(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)},squaredLength:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};c&&(c.glMatrixArrayType=l,c.MatrixArray=l,c.setMatrixArrayType=d,c.determineMatrixArrayType= -f,c.glMath=g,c.vec2=M,c.vec3=j,c.vec4=N,c.mat2=L,c.mat3=F,c.mat4=y,c.quat4=s);return{glMatrixArrayType:l,MatrixArray:l,setMatrixArrayType:d,determineMatrixArrayType:f,glMath:g,vec2:M,vec3:j,vec4:N,mat2:L,mat3:F,mat4:y,quat4:s}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * vColor;","}"]; -PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"]; -PIXI.CompileVertexShader=function(c,d){for(var f="",g=0;g 0) { - this.checkVisibility(child); + this.checkVisibility(child, actualVisibility); } + + }; } -/** - * @private - */ -PIXI.WebGLRenderer.prototype.setGLVisible = function(displayObject, visibility) -{ - var children = displayObject.children; - - for (var i=0; i < children.length; i++) - { - var child = children[i]; - - if(visibility) - { - this.addDisplayObject(child); - } - else - { - this.removeDisplayObject(child); - } - - if(child.children.length > 0) - { - this.setGLVisible(child, visibility); - } - } - -} - /** * Renders the stage to its webGL view - * @param the PIXI.Stage element to be rendered + * @method render + * @param stage {Stage} the PIXI.Stage element to be rendered */ PIXI.WebGLRenderer.prototype.render = function(stage) { @@ -185,9 +164,18 @@ // update children if need be // best to remove first! - for (var i=0; i < stage.__childrenRemoved.length; i++) this.removeDisplayObject(stage.__childrenRemoved[i]); + for (var i=0; i < stage.__childrenRemoved.length; i++) + { + this.removeDisplayObject(stage.__childrenRemoved[i]); + // stage.__childrenRemoved[i].cacheVisible = false; + } + /* // no add all new sprites - for (var i=0; i < stage.__childrenAdded.length; i++) this.addDisplayObject(stage.__childrenAdded[i]); + for (var i=0; i < stage.__childrenAdded.length; i++) + { + stage.__childrenAdded[i].cacheVisible = false; +// this.addDisplayObject(stage.__childrenAdded[i]); + }*/ // update any textures for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]); @@ -197,7 +185,7 @@ PIXI.texturesToUpdate = []; // recursivly loop through all items! - this.checkVisibility(stage); + this.checkVisibility(stage, true); // update the scen graph stage.updateTransform(); @@ -206,7 +194,7 @@ gl.clear(gl.COLOR_BUFFER_BIT) - gl.clearColor(1, 1, 1, 1.0); + gl.clearColor(0, 0, 0, 1.0); // set the correct blend mode! gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); @@ -265,12 +253,16 @@ */ PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject) { - if(!displayObject.stage)return; - displayObject.cacheVisible = displayObject.visible; + if(!displayObject.stage)return; // means it was removed + if(displayObject.__inWebGL)return; //means it is already in webgL - if(!displayObject.visible)return; + //displayObject.cacheVisible = displayObject.visible; + + // TODO if objects parent is not visible then dont add to stage!!!! + //if(!displayObject.visible)return; + displayObject.batch = null; //displayObject.cacheVisible = true; @@ -458,10 +450,12 @@ PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject) { //if(displayObject.stage)return; - displayObject.cacheVisible = displayObject.visible; + displayObject.cacheVisible = false;//displayObject.visible; if(!displayObject.renderable)return; + displayObject.__inWebGL = false; + /* * removing is a lot quicker.. * @@ -472,9 +466,11 @@ { // should always have a batch! var batch = displayObject.batch; - if(!batch)return; // thismeans the display list has been altered befre rendering + if(!batch)return; // this means the display list has been altered befre rendering batch.remove(displayObject); + + if(batch.size==0) { batchToRemove = batch @@ -528,8 +524,9 @@ /** * resizes the webGL view to the specified width and height - * @param the new width of the webGL view - * @param the new height of the webGL view + * @method resize + * @param width {Number} the new width of the webGL view + * @param height {Number} the new height of the webGL view */ PIXI.WebGLRenderer.prototype.resize = function(width, height) { diff --git a/src/pixi/renderers/WebGLShaders.js b/src/pixi/renderers/WebGLShaders.js index 8a109dc..b717256 100644 --- a/src/pixi/renderers/WebGLShaders.js +++ b/src/pixi/renderers/WebGLShaders.js @@ -2,7 +2,6 @@ /** * @author Mat Groves http://matgroves.com/ */ -var PIXI = PIXI || {}; PIXI.shaderFragmentSrc = [ "precision mediump float;", "varying vec2 vTextureCoord;", diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/examples/bunny benchmark/index.html b/examples/bunny benchmark/index.html index 7c5521b..95972c4 100644 --- a/examples/bunny benchmark/index.html +++ b/examples/bunny benchmark/index.html @@ -9,9 +9,10 @@ +
    Click to add more bunnys! Let me know how many you get on screen here @doormat23
    - + diff --git a/examples/bunny benchmark/js/bunnyBenchMark.js b/examples/bunny benchmark/js/bunnyBenchMark.js index a3154eb..c3c8ec5 100644 --- a/examples/bunny benchmark/js/bunnyBenchMark.js +++ b/examples/bunny benchmark/js/bunnyBenchMark.js @@ -22,18 +22,13 @@ var count = 0; var container; +var detail; + function onReady() { - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() + detail = document.getElementById("pixi"); - if(webgl) - { - renderer = new PIXI.WebGLRenderer(); - } - else - { - renderer = new PIXI.CanvasRenderer(480, 320); - } + renderer = PIXI.autoDetectRenderer(); stage = new PIXI.Stage; @@ -46,7 +41,7 @@ stats.domElement.style.top = "0px"; requestAnimFrame(update); - wabbitTexture = new PIXI.Texture("wabbit.png") + wabbitTexture = new PIXI.Texture.fromImage("wabbit.png") counter = document.createElement("div"); counter.className = "counter"; @@ -55,7 +50,6 @@ count = startBunnyCount; counter.innerHTML = count + " BUNNIES"; - container = new PIXI.DisplayObjectContainer(); stage.addChild(container); @@ -114,7 +108,9 @@ minX = 0; maxY = height; minY = 0; - + + detail.style.left = width - 204 + "px"; + detail.style.top = height - 100 + "px"; renderer.resize(width, height); } @@ -126,17 +122,17 @@ { // add 10 at a time :) - for (var i = 0; i < 2; i++) + for (var i = 0; i < 10; i++) { - var bunny = new PIXI.Sprite(wabbitTexture, {x:0, y:0, width:26, height:37}); + var bunny = new PIXI.Sprite(wabbitTexture); bunny.speedX = Math.random() * 10; bunny.speedY = (Math.random() * 10) - 5; bunny.anchor.x = 0.5; bunny.anchor.y = 1; - bunny.alpha = 0.3 + Math.random() * 0.7; + //bunny.alpha = 0.3 + Math.random() * 0.7; bunnys.push(bunny); - bunny.rotation = Math.random() - 0.5; + //bunny.rotation = Math.random() - 0.5; container.addChild(bunny); count++; diff --git a/examples/bunny benchmark/js/pixi.js b/examples/bunny benchmark/js/pixi.js new file mode 100644 index 0000000..65add09 --- /dev/null +++ b/examples/bunny benchmark/js/pixi.js @@ -0,0 +1,110 @@ +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, +d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* +j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= +a[0]-d[0],c=a[1]-d[1];a=a[2]-d[2];d=Math.sqrt(b*b+c*c+a*a);if(!d)return j[0]=0,j[1]=0,j[2]=0,j;d=1/d;j[0]=b*d;j[1]=c*d;j[2]=a*d;return j},lerp:function(a,d,j,b){b||(b=a);b[0]=a[0]+j*(d[0]-a[0]);b[1]=a[1]+j*(d[1]-a[1]);b[2]=a[2]+j*(d[2]-a[2]);return b},dist:function(a,d){var j=d[0]-a[0],b=d[1]-a[1],c=d[2]-a[2];return Math.sqrt(j*j+b*b+c*c)}},p=null,q=new k(4);l.unproject=function(a,d,j,b,c){c||(c=a);p||(p=t.create());var e=p;q[0]=2*(a[0]-b[0])/b[2]-1;q[1]=2*(a[1]-b[1])/b[3]-1;q[2]=2*a[2]-1;q[3]=1; +t.multiply(j,d,e);if(!t.inverse(e))return null;t.multiplyVec4(e,q);if(0===q[3])return null;c[0]=q[0]/q[3];c[1]=q[1]/q[3];c[2]=q[2]/q[3];return c};var C=l.createFrom(1,0,0),F=l.createFrom(0,1,0),u=l.createFrom(0,0,1),w=l.create();l.rotationTo=function(a,d,j){j||(j=m.create());var b=l.dot(a,d);if(1<=b)m.set(H,j);else if(-0.999999>b)l.cross(C,a,w),1E-6>l.length(w)&&l.cross(F,a,w),1E-6>l.length(w)&&l.cross(u,a,w),l.normalize(w),m.fromAngleAxis(Math.PI,w,j);else{var b=Math.sqrt(2*(1+b)),c=1/b;l.cross(a, +d,w);j[0]=w[0]*c;j[1]=w[1]*c;j[2]=w[2]*c;j[3]=0.5*b;m.normalize(j)}1j[3]&&(j[3]=-1);return j};l.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var x={create:function(a){var d=new k(9);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8]):d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=0;return d},createFrom:function(a,d,j,b,c,e,n,f,E){var s=new k(9);s[0]=a;s[1]=d;s[2]=j;s[3]=b;s[4]=c;s[5]=e;s[6]=n;s[7]=f;s[8]=E;return s},determinant:function(a){var d= +a[3],j=a[4],b=a[5],c=a[6],e=a[7],n=a[8];return a[0]*(n*j-b*e)+a[1]*(-n*d+b*c)+a[2]*(e*d-j*c)},inverse:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[3],n=a[4],f=a[5],E=a[6],s=a[7],I=a[8],g=I*n-f*s,h=-I*e+f*E,k=s*e-n*E,r=j*g+b*h+c*k;if(!r)return null;r=1/r;d||(d=x.create());d[0]=g*r;d[1]=(-I*b+c*s)*r;d[2]=(f*b-c*n)*r;d[3]=h*r;d[4]=(I*j-c*E)*r;d[5]=(-f*j+c*e)*r;d[6]=k*r;d[7]=(-s*j+b*E)*r;d[8]=(n*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],D=a[4],E=a[5],s=a[6],I= +a[7];a=a[8];var g=d[0],h=d[1],k=d[2],r=d[3],m=d[4],l=d[5],q=d[6],v=d[7];d=d[8];j[0]=g*b+h*f+k*s;j[1]=g*c+h*D+k*I;j[2]=g*e+h*E+k*a;j[3]=r*b+m*f+l*s;j[4]=r*c+m*D+l*I;j[5]=r*e+m*E+l*a;j[6]=q*b+v*f+d*s;j[7]=q*c+v*D+d*I;j[8]=q*e+v*E+d*a;return j},multiplyVec2:function(a,d,j){j||(j=d);var b=d[0];d=d[1];j[0]=b*a[0]+d*a[3]+a[6];j[1]=b*a[1]+d*a[4]+a[7];return j},multiplyVec3:function(a,d,j){j||(j=d);var b=d[0],c=d[1];d=d[2];j[0]=b*a[0]+c*a[3]+d*a[6];j[1]=b*a[1]+c*a[4]+d*a[7];j[2]=b*a[2]+c*a[5]+d*a[8];return j}, +set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])},identity:function(a){a||(a=x.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, +d){if(!d||a===d){var j=a[1],b=a[2],c=a[5];a[1]=a[3];a[2]=a[6];a[3]=j;a[5]=a[7];a[6]=b;a[7]=c;return a}d[0]=a[0];d[1]=a[3];d[2]=a[6];d[3]=a[1];d[4]=a[4];d[5]=a[7];d[6]=a[2];d[7]=a[5];d[8]=a[8];return d},toMat4:function(a,d){d||(d=t.create());d[15]=1;d[14]=0;d[13]=0;d[12]=0;d[11]=0;d[10]=a[8];d[9]=a[7];d[8]=a[6];d[7]=0;d[6]=a[5];d[5]=a[4];d[4]=a[3];d[3]=0;d[2]=a[2];d[1]=a[1];d[0]=a[0];return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ +a[8]+"]"}},t={create:function(a){var d=new k(16);a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8],d[9]=a[9],d[10]=a[10],d[11]=a[11],d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d},createFrom:function(a,d,j,b,c,e,f,D,E,s,g,h,m,l,r,q){var A=new k(16);A[0]=a;A[1]=d;A[2]=j;A[3]=b;A[4]=c;A[5]=e;A[6]=f;A[7]=D;A[8]=E;A[9]=s;A[10]=g;A[11]=h;A[12]=m;A[13]=l;A[14]=r;A[15]=q;return A},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4]; +d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=a[12];d[13]=a[13];d[14]=a[14];d[15]=a[15];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])&&1E-6>Math.abs(a[9]-d[9])&&1E-6>Math.abs(a[10]-d[10])&&1E-6>Math.abs(a[11]-d[11])&&1E-6>Math.abs(a[12]- +d[12])&&1E-6>Math.abs(a[13]-d[13])&&1E-6>Math.abs(a[14]-d[14])&&1E-6>Math.abs(a[15]-d[15])},identity:function(a){a||(a=t.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,d){if(!d||a===d){var j=a[1],b=a[2],c=a[3],e=a[6],f=a[7],D=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=j;a[6]=a[9];a[7]=a[13];a[8]=b;a[9]=e;a[11]=a[14];a[12]=c;a[13]=f;a[14]=D;return a}d[0]=a[0];d[1]=a[4];d[2]=a[8];d[3]=a[12]; +d[4]=a[1];d[5]=a[5];d[6]=a[9];d[7]=a[13];d[8]=a[2];d[9]=a[6];d[10]=a[10];d[11]=a[14];d[12]=a[3];d[13]=a[7];d[14]=a[11];d[15]=a[15];return d},determinant:function(a){var d=a[0],j=a[1],b=a[2],c=a[3],e=a[4],f=a[5],D=a[6],E=a[7],s=a[8],g=a[9],h=a[10],k=a[11],m=a[12],r=a[13],l=a[14];a=a[15];return m*g*D*c-s*r*D*c-m*f*h*c+e*r*h*c+s*f*l*c-e*g*l*c-m*g*b*E+s*r*b*E+m*j*h*E-d*r*h*E-s*j*l*E+d*g*l*E+m*f*b*k-e*r*b*k-m*j*D*k+d*r*D*k+e*j*l*k-d*f*l*k-s*f*b*a+e*g*b*a+s*j*D*a-d*g*D*a-e*j*h*a+d*f*h*a},inverse:function(a, +d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=a[3],f=a[4],D=a[5],E=a[6],s=a[7],g=a[8],h=a[9],k=a[10],m=a[11],r=a[12],l=a[13],A=a[14],q=a[15],v=j*D-b*f,J=j*E-c*f,y=j*s-e*f,z=b*E-c*D,t=b*s-e*D,u=c*s-e*E,p=g*l-h*r,w=g*A-k*r,x=g*q-m*r,B=h*A-k*l,C=h*q-m*l,F=k*q-m*A,G=v*F-J*C+y*B+z*x-t*w+u*p;if(!G)return null;G=1/G;d[0]=(D*F-E*C+s*B)*G;d[1]=(-b*F+c*C-e*B)*G;d[2]=(l*u-A*t+q*z)*G;d[3]=(-h*u+k*t-m*z)*G;d[4]=(-f*F+E*x-s*w)*G;d[5]=(j*F-c*x+e*w)*G;d[6]=(-r*u+A*y-q*J)*G;d[7]=(g*u-k*y+m*J)*G;d[8]=(f*C-D*x+s*p)*G;d[9]= +(-j*C+b*x-e*p)*G;d[10]=(r*t-l*y+q*v)*G;d[11]=(-g*t+h*y-m*v)*G;d[12]=(-f*B+D*w-E*p)*G;d[13]=(j*B-b*w+c*p)*G;d[14]=(-r*z+l*J-A*v)*G;d[15]=(g*z-h*J+k*v)*G;return d},toRotationMat:function(a,d){d||(d=t.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d},toMat3:function(a,d){d||(d=x.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[4];d[4]=a[5];d[5]=a[6];d[6]=a[8];d[7]=a[9];d[8]=a[10]; +return d},toInverseMat3:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[4],f=a[5],D=a[6],g=a[8],s=a[9],h=a[10],k=h*f-D*s,m=-h*e+D*g,l=s*e-f*g,r=j*k+b*m+c*l;if(!r)return null;r=1/r;d||(d=x.create());d[0]=k*r;d[1]=(-h*b+c*s)*r;d[2]=(D*b-c*f)*r;d[3]=m*r;d[4]=(h*j-c*g)*r;d[5]=(-D*j+c*e)*r;d[6]=l*r;d[7]=(-s*j+b*g)*r;d[8]=(f*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],s=a[6],k=a[7],m=a[8],l=a[9],q=a[10],r=a[11],t=a[12],A=a[13],u=a[14];a=a[15];var v=d[0], +p=d[1],y=d[2],z=d[3];j[0]=v*b+p*g+y*m+z*t;j[1]=v*c+p*h+y*l+z*A;j[2]=v*e+p*s+y*q+z*u;j[3]=v*f+p*k+y*r+z*a;v=d[4];p=d[5];y=d[6];z=d[7];j[4]=v*b+p*g+y*m+z*t;j[5]=v*c+p*h+y*l+z*A;j[6]=v*e+p*s+y*q+z*u;j[7]=v*f+p*k+y*r+z*a;v=d[8];p=d[9];y=d[10];z=d[11];j[8]=v*b+p*g+y*m+z*t;j[9]=v*c+p*h+y*l+z*A;j[10]=v*e+p*s+y*q+z*u;j[11]=v*f+p*k+y*r+z*a;v=d[12];p=d[13];y=d[14];z=d[15];j[12]=v*b+p*g+y*m+z*t;j[13]=v*c+p*h+y*l+z*A;j[14]=v*e+p*s+y*q+z*u;j[15]=v*f+p*k+y*r+z*a;return j},multiplyVec3:function(a,d,b){b||(b=d); +var c=d[0],e=d[1];d=d[2];b[0]=a[0]*c+a[4]*e+a[8]*d+a[12];b[1]=a[1]*c+a[5]*e+a[9]*d+a[13];b[2]=a[2]*c+a[6]*e+a[10]*d+a[14];return b},multiplyVec4:function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=d[3];b[0]=a[0]*c+a[4]*e+a[8]*f+a[12]*d;b[1]=a[1]*c+a[5]*e+a[9]*f+a[13]*d;b[2]=a[2]*c+a[6]*e+a[10]*f+a[14]*d;b[3]=a[3]*c+a[7]*e+a[11]*f+a[15]*d;return b},translate:function(a,d,b){var c=d[0],e=d[1];d=d[2];var f,n,g,h,s,k,m,l,p,r,q,t;if(!b||a===b)return a[12]=a[0]*c+a[4]*e+a[8]*d+a[12],a[13]=a[1]*c+a[5]*e+ +a[9]*d+a[13],a[14]=a[2]*c+a[6]*e+a[10]*d+a[14],a[15]=a[3]*c+a[7]*e+a[11]*d+a[15],a;f=a[0];n=a[1];g=a[2];h=a[3];s=a[4];k=a[5];m=a[6];l=a[7];p=a[8];r=a[9];q=a[10];t=a[11];b[0]=f;b[1]=n;b[2]=g;b[3]=h;b[4]=s;b[5]=k;b[6]=m;b[7]=l;b[8]=p;b[9]=r;b[10]=q;b[11]=t;b[12]=f*c+s*e+p*d+a[12];b[13]=n*c+k*e+r*d+a[13];b[14]=g*c+m*e+q*d+a[14];b[15]=h*c+l*e+t*d+a[15];return b},scale:function(a,d,b){var c=d[0],e=d[1];d=d[2];if(!b||a===b)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=d,a[9]*= +d,a[10]*=d,a[11]*=d,a;b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[7]=a[7]*e;b[8]=a[8]*d;b[9]=a[9]*d;b[10]=a[10]*d;b[11]=a[11]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},rotate:function(a,d,b,c){var e=b[0],f=b[1];b=b[2];var n=Math.sqrt(e*e+f*f+b*b),g,h,k,m,l,p,q,r,t,u,w,v,x,y,z,B,C,F,H,K;if(!n)return null;1!==n&&(n=1/n,e*=n,f*=n,b*=n);g=Math.sin(d);h=Math.cos(d);k=1-h;d=a[0];n=a[1];m=a[2];l=a[3];p=a[4];q=a[5];r=a[6];t=a[7];u=a[8];w=a[9];v= +a[10];x=a[11];y=e*e*k+h;z=f*e*k+b*g;B=b*e*k-f*g;C=e*f*k-b*g;F=f*f*k+h;H=b*f*k+e*g;K=e*b*k+f*g;e=f*b*k-e*g;f=b*b*k+h;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=d*y+p*z+u*B;c[1]=n*y+q*z+w*B;c[2]=m*y+r*z+v*B;c[3]=l*y+t*z+x*B;c[4]=d*C+p*F+u*H;c[5]=n*C+q*F+w*H;c[6]=m*C+r*F+v*H;c[7]=l*C+t*F+x*H;c[8]=d*K+p*e+u*f;c[9]=n*K+q*e+w*f;c[10]=m*K+r*e+v*f;c[11]=l*K+t*e+x*f;return c},rotateX:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[4],f=a[5],n=a[6],g=a[7],h=a[8],k=a[9],m=a[10], +l=a[11];b?a!==b&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[4]=e*d+h*c;b[5]=f*d+k*c;b[6]=n*d+m*c;b[7]=g*d+l*c;b[8]=e*-c+h*d;b[9]=f*-c+k*d;b[10]=n*-c+m*d;b[11]=g*-c+l*d;return b},rotateY:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[8],k=a[9],m=a[10],l=a[11];b?a!==b&&(b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*-c;b[1]=f*d+k*-c;b[2]=n*d+m*-c;b[3]=g* +d+l*-c;b[8]=e*c+h*d;b[9]=f*c+k*d;b[10]=n*c+m*d;b[11]=g*c+l*d;return b},rotateZ:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[4],k=a[5],m=a[6],l=a[7];b?a!==b&&(b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*c;b[1]=f*d+k*c;b[2]=n*d+m*c;b[3]=g*d+l*c;b[4]=e*-c+h*d;b[5]=f*-c+k*d;b[6]=n*-c+m*d;b[7]=g*-c+l*d;return b},frustum:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2*e/g;n[1]=0; +n[2]=0;n[3]=0;n[4]=0;n[5]=2*e/h;n[6]=0;n[7]=0;n[8]=(d+a)/g;n[9]=(c+b)/h;n[10]=-(f+e)/k;n[11]=-1;n[12]=0;n[13]=0;n[14]=-(2*f*e)/k;n[15]=0;return n},perspective:function(a,d,b,c,e){a=b*Math.tan(a*Math.PI/360);d*=a;return t.frustum(-d,d,-a,a,b,c,e)},ortho:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2/g;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=2/h;n[6]=0;n[7]=0;n[8]=0;n[9]=0;n[10]=-2/k;n[11]=0;n[12]=-(a+d)/g;n[13]=-(c+b)/h;n[14]=-(f+e)/k;n[15]=1;return n},lookAt:function(a,d,b,c){c|| +(c=t.create());var e,f,n,g,h,k,m,l,p=a[0],q=a[1];a=a[2];n=b[0];g=b[1];f=b[2];m=d[0];b=d[1];e=d[2];if(p===m&&q===b&&a===e)return t.identity(c);d=p-m;b=q-b;m=a-e;l=1/Math.sqrt(d*d+b*b+m*m);d*=l;b*=l;m*=l;e=g*m-f*b;f=f*d-n*m;n=n*b-g*d;(l=Math.sqrt(e*e+f*f+n*n))?(l=1/l,e*=l,f*=l,n*=l):n=f=e=0;g=b*n-m*f;h=m*e-d*n;k=d*f-b*e;(l=Math.sqrt(g*g+h*h+k*k))?(l=1/l,g*=l,h*=l,k*=l):k=h=g=0;c[0]=e;c[1]=g;c[2]=d;c[3]=0;c[4]=f;c[5]=h;c[6]=b;c[7]=0;c[8]=n;c[9]=k;c[10]=m;c[11]=0;c[12]=-(e*p+f*q+n*a);c[13]=-(g*p+h*q+ +k*a);c[14]=-(d*p+b*q+m*a);c[15]=1;return c},fromRotationTranslation:function(a,d,b){b||(b=t.create());var c=a[0],e=a[1],f=a[2],n=a[3],g=c+c,h=e+e,k=f+f;a=c*g;var l=c*h,c=c*k,m=e*h,e=e*k,f=f*k,g=n*g,h=n*h,n=n*k;b[0]=1-(m+f);b[1]=l+n;b[2]=c-h;b[3]=0;b[4]=l-n;b[5]=1-(a+f);b[6]=e+g;b[7]=0;b[8]=c+h;b[9]=e-g;b[10]=1-(a+m);b[11]=0;b[12]=d[0];b[13]=d[1];b[14]=d[2];b[15]=1;return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ +a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},m={create:function(a){var d=new k(4);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]):d[0]=d[1]=d[2]=d[3]=0;return d},createFrom:function(a,d,b,c){var e=new k(4);e[0]=a;e[1]=d;e[2]=b;e[3]=c;return e},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])},identity:function(a){a||(a=m.create()); +a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},H=m.identity();m.calculateW=function(a,d){var b=a[0],c=a[1],e=a[2];if(!d||a===d)return a[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e)),a;d[0]=b;d[1]=c;d[2]=e;d[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e));return d};m.dot=function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3]};m.inverse=function(a,d){var b=a[0],c=a[1],e=a[2],f=a[3],b=(b=b*b+c*c+e*e+f*f)?1/b:0;if(!d||a===d)return a[0]*=-b,a[1]*=-b,a[2]*=-b,a[3]*=b,a;d[0]=-a[0]*b;d[1]=-a[1]*b;d[2]=-a[2]*b;d[3]=a[3]*b; +return d};m.conjugate=function(a,d){if(!d||a===d)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=a[3];return d};m.length=function(a){var d=a[0],b=a[1],c=a[2];a=a[3];return Math.sqrt(d*d+b*b+c*c+a*a)};m.normalize=function(a,d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=Math.sqrt(b*b+c*c+e*e+f*f);if(0===g)return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d;g=1/g;d[0]=b*g;d[1]=c*g;d[2]=e*g;d[3]=f*g;return d};m.add=function(a,d,b){if(!b||a===b)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a[3]+= +d[3],a;b[0]=a[0]+d[0];b[1]=a[1]+d[1];b[2]=a[2]+d[2];b[3]=a[3]+d[3];return b};m.multiply=function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2];a=a[3];var g=d[0],h=d[1],k=d[2];d=d[3];b[0]=c*d+a*g+e*k-f*h;b[1]=e*d+a*h+f*g-c*k;b[2]=f*d+a*k+c*h-e*g;b[3]=a*d-c*g-e*h-f*k;return b};m.multiplyVec3=function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=a[0];var g=a[1],h=a[2];a=a[3];var k=a*c+g*f-h*e,l=a*e+h*c-d*f,m=a*f+d*e-g*c,c=-d*c-g*e-h*f;b[0]=k*a+c*-d+l*-h-m*-g;b[1]=l*a+c*-g+m*-d-k*-h;b[2]=m*a+c*-h+k*-g-l*-d; +return b};m.scale=function(a,d,b){if(!b||a===b)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a;b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[3]=a[3]*d;return b};m.toMat3=function(a,d){d||(d=x.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b*k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=m-f;d[4]=1-(l+e);d[5]=c+g;d[6]=b+h;d[7]=c-g;d[8]=1-(l+p);return d};m.toMat4=function(a,d){d||(d=t.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b* +k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=0;d[4]=m-f;d[5]=1-(l+e);d[6]=c+g;d[7]=0;d[8]=b+h;d[9]=c-g;d[10]=1-(l+p);d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d};m.slerp=function(a,d,b,c){c||(c=a);var e=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3],f,g;if(1<=Math.abs(e))return c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]),c;f=Math.acos(e);g=Math.sqrt(1-e*e);if(0.0010>Math.abs(g))return c[0]=0.5*a[0]+0.5*d[0],c[1]=0.5*a[1]+0.5*d[1],c[2]=0.5*a[2]+0.5*d[2],c[3]=0.5*a[3]+ +0.5*d[3],c;e=Math.sin((1-b)*f)/g;b=Math.sin(b*f)/g;c[0]=a[0]*e+d[0]*b;c[1]=a[1]*e+d[1]*b;c[2]=a[2]*e+d[2]*b;c[3]=a[3]*e+d[3]*b;return c};m.fromRotationMatrix=function(a,d){d||(d=m.create());var b=a[0]+a[4]+a[8],c;if(0a[0]&&(b=1);a[8]>a[3*b+b]&&(b=2);var e=c[b],f=c[e];c=Math.sqrt(a[3*b+b]-a[3*e+e]-a[3*f+f]+1);d[b]=0.5*c;c= +0.5/c;d[3]=(a[3*f+e]-a[3*e+f])*c;d[e]=(a[3*e+b]+a[3*b+e])*c;d[f]=(a[3*f+b]+a[3*b+f])*c}return d};x.toQuat4=m.fromRotationMatrix;var B=x.create();m.fromAxes=function(a,d,b,c){B[0]=d[0];B[3]=d[1];B[6]=d[2];B[1]=b[0];B[4]=b[1];B[7]=b[2];B[2]=a[0];B[5]=a[1];B[8]=a[2];return m.fromRotationMatrix(B,c)};m.identity=function(a){a||(a=m.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};m.fromAngleAxis=function(a,d,b){b||(b=m.create());a*=0.5;var c=Math.sin(a);b[3]=Math.cos(a);b[0]=c*d[0];b[1]=c*d[1];b[2]=c*d[2]; +return b};m.toAngleAxis=function(a,d){d||(d=a);var b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); +b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 +Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],e=a[1],f=a[2],g=a[3],h=c*g-f*e;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-e*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, +b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];c[0]=e*b[0]+f*b[2];c[1]=e*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=e*b+f*h;c[1]=e*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var e=b[0];b=b[1];c[0]=e*a[0]+b*a[1];c[1]=e*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var e=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=e*b;c[2]=f*h;c[3]= +g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, +b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| +(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= +f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; +PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; +PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l>1);var b=m[0];return b*(1.5-0.5*a*b*b)}}else g.invsqrt=function(a){return 1/Math.sqrt(a)}; -var l=null;f();var j={create:function(a){var b=new l(3);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0;return b},createFrom:function(a,b,e){var c=new l(3);c[0]=a;c[1]=b;c[2]=e;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])},add:function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];return e},subtract:function(a, -b,e){if(!e||a===e)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];return e},multiply:function(a,b,e){if(!e||a===e)return a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a;e[0]=a[0]*b[0];e[1]=a[1]*b[1];e[2]=a[2]*b[2];return e},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;return e},normalize:function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=Math.sqrt(e* -e+c*c+d*d);if(!k)return b[0]=0,b[1]=0,b[2]=0,b;if(1===k)return b[0]=e,b[1]=c,b[2]=d,b;k=1/k;b[0]=e*k;b[1]=c*k;b[2]=d*k;return b},cross:function(a,b,e){e||(e=a);var c=a[0],d=a[1];a=a[2];var k=b[0],h=b[1];b=b[2];e[0]=d*b-a*h;e[1]=a*k-c*b;e[2]=c*h-d*k;return e},length:function(a){var b=a[0],e=a[1];a=a[2];return Math.sqrt(b*b+e*e+a*a)},squaredLength:function(a){var b=a[0],e=a[1];a=a[2];return b*b+e*e+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,b,e){e||(e=a);var c= -a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];b=Math.sqrt(c*c+d*d+a*a);if(!b)return e[0]=0,e[1]=0,e[2]=0,e;b=1/b;e[0]=c*b;e[1]=d*b;e[2]=a*b;return e},lerp:function(a,b,e,c){c||(c=a);c[0]=a[0]+e*(b[0]-a[0]);c[1]=a[1]+e*(b[1]-a[1]);c[2]=a[2]+e*(b[2]-a[2]);return c},dist:function(a,b){var e=b[0]-a[0],c=b[1]-a[1],d=b[2]-a[2];return Math.sqrt(e*e+c*c+d*d)}},x=null,n=new l(4);j.unproject=function(a,b,e,c,d){d||(d=a);x||(x=y.create());var k=x;n[0]=2*(a[0]-c[0])/c[2]-1;n[1]=2*(a[1]-c[1])/c[3]-1;n[2]=2*a[2]-1;n[3]=1; -y.multiply(e,b,k);if(!y.inverse(k))return null;y.multiplyVec4(k,n);if(0===n[3])return null;d[0]=n[0]/n[3];d[1]=n[1]/n[3];d[2]=n[2]/n[3];return d};var z=j.createFrom(1,0,0),A=j.createFrom(0,1,0),H=j.createFrom(0,0,1),C=j.create();j.rotationTo=function(a,b,e){e||(e=s.create());var c=j.dot(a,b);if(1<=c)s.set(O,e);else if(-0.999999>c)j.cross(z,a,C),1E-6>j.length(C)&&j.cross(A,a,C),1E-6>j.length(C)&&j.cross(H,a,C),j.normalize(C),s.fromAngleAxis(Math.PI,C,e);else{var c=Math.sqrt(2*(1+c)),d=1/c;j.cross(a, -b,C);e[0]=C[0]*d;e[1]=C[1]*d;e[2]=C[2]*d;e[3]=0.5*c;s.normalize(e)}1e[3]&&(e[3]=-1);return e};j.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var F={create:function(a){var b=new l(9);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0;return b},createFrom:function(a,b,e,c,d,k,h,E,K){var q=new l(9);q[0]=a;q[1]=b;q[2]=e;q[3]=c;q[4]=d;q[5]=k;q[6]=h;q[7]=E;q[8]=K;return q},determinant:function(a){var b= -a[3],e=a[4],c=a[5],d=a[6],k=a[7],h=a[8];return a[0]*(h*e-c*k)+a[1]*(-h*b+c*d)+a[2]*(k*b-e*d)},inverse:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],E=a[5],K=a[6],q=a[7],f=a[8],g=f*h-E*q,j=-f*k+E*K,J=q*k-h*K,r=e*g+c*j+d*J;if(!r)return null;r=1/r;b||(b=F.create());b[0]=g*r;b[1]=(-f*c+d*q)*r;b[2]=(E*c-d*h)*r;b[3]=j*r;b[4]=(f*e-d*K)*r;b[5]=(-E*e+d*k)*r;b[6]=J*r;b[7]=(-q*e+c*K)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],E=a[4],f=a[5],q=a[6],g= -a[7];a=a[8];var u=b[0],j=b[1],J=b[2],r=b[3],l=b[4],t=b[5],m=b[6],p=b[7];b=b[8];e[0]=u*c+j*h+J*q;e[1]=u*d+j*E+J*g;e[2]=u*k+j*f+J*a;e[3]=r*c+l*h+t*q;e[4]=r*d+l*E+t*g;e[5]=r*k+l*f+t*a;e[6]=m*c+p*h+b*q;e[7]=m*d+p*E+b*g;e[8]=m*k+p*f+b*a;return e},multiplyVec2:function(a,b,e){e||(e=b);var c=b[0];b=b[1];e[0]=c*a[0]+b*a[3]+a[6];e[1]=c*a[1]+b*a[4]+a[7];return e},multiplyVec3:function(a,b,e){e||(e=b);var c=b[0],d=b[1];b=b[2];e[0]=c*a[0]+d*a[3]+b*a[6];e[1]=c*a[1]+d*a[4]+b*a[7];e[2]=c*a[2]+d*a[5]+b*a[8];return e}, -set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])},identity:function(a){a||(a=F.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, -b){if(!b||a===b){var e=a[1],c=a[2],d=a[5];a[1]=a[3];a[2]=a[6];a[3]=e;a[5]=a[7];a[6]=c;a[7]=d;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]=a[8];return b},toMat4:function(a,b){b||(b=y.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ -a[8]+"]"}},y={create:function(a){var b=new l(16);a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]);return b},createFrom:function(a,b,e,c,d,k,h,E,f,q,g,u,j,J,r,m){var t=new l(16);t[0]=a;t[1]=b;t[2]=e;t[3]=c;t[4]=d;t[5]=k;t[6]=h;t[7]=E;t[8]=f;t[9]=q;t[10]=g;t[11]=u;t[12]=j;t[13]=J;t[14]=r;t[15]=m;return t},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4]; -b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])&&1E-6>Math.abs(a[9]-b[9])&&1E-6>Math.abs(a[10]-b[10])&&1E-6>Math.abs(a[11]-b[11])&&1E-6>Math.abs(a[12]- -b[12])&&1E-6>Math.abs(a[13]-b[13])&&1E-6>Math.abs(a[14]-b[14])&&1E-6>Math.abs(a[15]-b[15])},identity:function(a){a||(a=y.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){var e=a[1],c=a[2],d=a[3],k=a[6],h=a[7],E=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=e;a[6]=a[9];a[7]=a[13];a[8]=c;a[9]=k;a[11]=a[14];a[12]=d;a[13]=h;a[14]=E;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12]; -b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b=a[0],e=a[1],c=a[2],d=a[3],k=a[4],h=a[5],E=a[6],f=a[7],g=a[8],I=a[9],u=a[10],j=a[11],l=a[12],r=a[13],m=a[14];a=a[15];return l*I*E*d-g*r*E*d-l*h*u*d+k*r*u*d+g*h*m*d-k*I*m*d-l*I*c*f+g*r*c*f+l*e*u*f-b*r*u*f-g*e*m*f+b*I*m*f+l*h*c*j-k*r*c*j-l*e*E*j+b*r*E*j+k*e*m*j-b*h*m*j-g*h*c*a+k*I*c*a+g*e*E*a-b*I*E*a-k*e*u*a+b*h*u*a},inverse:function(a, -b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],f=a[5],g=a[6],q=a[7],I=a[8],u=a[9],j=a[10],l=a[11],r=a[12],m=a[13],t=a[14],p=a[15],s=e*f-c*h,n=e*g-d*h,v=e*q-k*h,w=c*g-d*f,x=c*q-k*f,y=d*q-k*g,z=I*m-u*r,A=I*t-j*r,C=I*p-l*r,D=u*t-j*m,F=u*p-l*m,H=j*p-l*t,G=s*H-n*F+v*D+w*C-x*A+y*z;if(!G)return null;G=1/G;b[0]=(f*H-g*F+q*D)*G;b[1]=(-c*H+d*F-k*D)*G;b[2]=(m*y-t*x+p*w)*G;b[3]=(-u*y+j*x-l*w)*G;b[4]=(-h*H+g*C-q*A)*G;b[5]=(e*H-d*C+k*A)*G;b[6]=(-r*y+t*v-p*n)*G;b[7]=(I*y-j*v+l*n)*G;b[8]=(h*F-f*C+q*z)*G;b[9]= -(-e*F+c*C-k*z)*G;b[10]=(r*x-m*v+p*s)*G;b[11]=(-I*x+u*v-l*s)*G;b[12]=(-h*D+f*A-g*z)*G;b[13]=(e*D-c*A+d*z)*G;b[14]=(-r*w+m*n-t*s)*G;b[15]=(I*w-u*n+j*s)*G;return b},toRotationMat:function(a,b){b||(b=y.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=F.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10]; -return b},toInverseMat3:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[4],h=a[5],f=a[6],g=a[8],q=a[9],j=a[10],u=j*h-f*q,l=-j*k+f*g,m=q*k-h*g,r=e*u+c*l+d*m;if(!r)return null;r=1/r;b||(b=F.create());b[0]=u*r;b[1]=(-j*c+d*q)*r;b[2]=(f*c-d*h)*r;b[3]=l*r;b[4]=(j*e-d*g)*r;b[5]=(-f*e+d*k)*r;b[6]=m*r;b[7]=(-q*e+c*g)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],f=a[4],g=a[5],q=a[6],j=a[7],u=a[8],l=a[9],m=a[10],r=a[11],p=a[12],t=a[13],s=a[14];a=a[15];var n=b[0], -B=b[1],v=b[2],w=b[3];e[0]=n*c+B*f+v*u+w*p;e[1]=n*d+B*g+v*l+w*t;e[2]=n*k+B*q+v*m+w*s;e[3]=n*h+B*j+v*r+w*a;n=b[4];B=b[5];v=b[6];w=b[7];e[4]=n*c+B*f+v*u+w*p;e[5]=n*d+B*g+v*l+w*t;e[6]=n*k+B*q+v*m+w*s;e[7]=n*h+B*j+v*r+w*a;n=b[8];B=b[9];v=b[10];w=b[11];e[8]=n*c+B*f+v*u+w*p;e[9]=n*d+B*g+v*l+w*t;e[10]=n*k+B*q+v*m+w*s;e[11]=n*h+B*j+v*r+w*a;n=b[12];B=b[13];v=b[14];w=b[15];e[12]=n*c+B*f+v*u+w*p;e[13]=n*d+B*g+v*l+w*t;e[14]=n*k+B*q+v*m+w*s;e[15]=n*h+B*j+v*r+w*a;return e},multiplyVec3:function(a,b,e){e||(e=b); -var c=b[0],d=b[1];b=b[2];e[0]=a[0]*c+a[4]*d+a[8]*b+a[12];e[1]=a[1]*c+a[5]*d+a[9]*b+a[13];e[2]=a[2]*c+a[6]*d+a[10]*b+a[14];return e},multiplyVec4:function(a,b,e){e||(e=b);var c=b[0],d=b[1],k=b[2];b=b[3];e[0]=a[0]*c+a[4]*d+a[8]*k+a[12]*b;e[1]=a[1]*c+a[5]*d+a[9]*k+a[13]*b;e[2]=a[2]*c+a[6]*d+a[10]*k+a[14]*b;e[3]=a[3]*c+a[7]*d+a[11]*k+a[15]*b;return e},translate:function(a,b,e){var c=b[0],d=b[1];b=b[2];var k,h,f,g,q,j,u,l,m,n,p,s;if(!e||a===e)return a[12]=a[0]*c+a[4]*d+a[8]*b+a[12],a[13]=a[1]*c+a[5]*d+ -a[9]*b+a[13],a[14]=a[2]*c+a[6]*d+a[10]*b+a[14],a[15]=a[3]*c+a[7]*d+a[11]*b+a[15],a;k=a[0];h=a[1];f=a[2];g=a[3];q=a[4];j=a[5];u=a[6];l=a[7];m=a[8];n=a[9];p=a[10];s=a[11];e[0]=k;e[1]=h;e[2]=f;e[3]=g;e[4]=q;e[5]=j;e[6]=u;e[7]=l;e[8]=m;e[9]=n;e[10]=p;e[11]=s;e[12]=k*c+q*d+m*b+a[12];e[13]=h*c+j*d+n*b+a[13];e[14]=f*c+u*d+p*b+a[14];e[15]=g*c+l*d+s*b+a[15];return e},scale:function(a,b,e){var c=b[0],d=b[1];b=b[2];if(!e||a===e)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=d,a[5]*=d,a[6]*=d,a[7]*=d,a[8]*=b,a[9]*= -b,a[10]*=b,a[11]*=b,a;e[0]=a[0]*c;e[1]=a[1]*c;e[2]=a[2]*c;e[3]=a[3]*c;e[4]=a[4]*d;e[5]=a[5]*d;e[6]=a[6]*d;e[7]=a[7]*d;e[8]=a[8]*b;e[9]=a[9]*b;e[10]=a[10]*b;e[11]=a[11]*b;e[12]=a[12];e[13]=a[13];e[14]=a[14];e[15]=a[15];return e},rotate:function(a,b,e,c){var d=e[0],k=e[1];e=e[2];var h=Math.sqrt(d*d+k*k+e*e),f,g,q,j,l,m,n,r,p,s,x,y,B,v,w,z,A,C,D,F;if(!h)return null;1!==h&&(h=1/h,d*=h,k*=h,e*=h);f=Math.sin(b);g=Math.cos(b);q=1-g;b=a[0];h=a[1];j=a[2];l=a[3];m=a[4];n=a[5];r=a[6];p=a[7];s=a[8];x=a[9];y= -a[10];B=a[11];v=d*d*q+g;w=k*d*q+e*f;z=e*d*q-k*f;A=d*k*q-e*f;C=k*k*q+g;D=e*k*q+d*f;F=d*e*q+k*f;d=k*e*q-d*f;k=e*e*q+g;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=b*v+m*w+s*z;c[1]=h*v+n*w+x*z;c[2]=j*v+r*w+y*z;c[3]=l*v+p*w+B*z;c[4]=b*A+m*C+s*D;c[5]=h*A+n*C+x*D;c[6]=j*A+r*C+y*D;c[7]=l*A+p*C+B*D;c[8]=b*F+m*d+s*k;c[9]=h*F+n*d+x*k;c[10]=j*F+r*d+y*k;c[11]=l*F+p*d+B*k;return c},rotateX:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[4],k=a[5],h=a[6],f=a[7],g=a[8],q=a[9],j=a[10], -l=a[11];e?a!==e&&(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[4]=d*b+g*c;e[5]=k*b+q*c;e[6]=h*b+j*c;e[7]=f*b+l*c;e[8]=d*-c+g*b;e[9]=k*-c+q*b;e[10]=h*-c+j*b;e[11]=f*-c+l*b;return e},rotateY:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[8],j=a[9],l=a[10],m=a[11];e?a!==e&&(e[4]=a[4],e[5]=a[5],e[6]=a[6],e[7]=a[7],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*-c;e[1]=k*b+j*-c;e[2]=h*b+l*-c;e[3]=f* -b+m*-c;e[8]=d*c+g*b;e[9]=k*c+j*b;e[10]=h*c+l*b;e[11]=f*c+m*b;return e},rotateZ:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[4],j=a[5],l=a[6],m=a[7];e?a!==e&&(e[8]=a[8],e[9]=a[9],e[10]=a[10],e[11]=a[11],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*c;e[1]=k*b+j*c;e[2]=h*b+l*c;e[3]=f*b+m*c;e[4]=d*-c+g*b;e[5]=k*-c+j*b;e[6]=h*-c+l*b;e[7]=f*-c+m*b;return e},frustum:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2*d/f;h[1]=0; -h[2]=0;h[3]=0;h[4]=0;h[5]=2*d/g;h[6]=0;h[7]=0;h[8]=(b+a)/f;h[9]=(c+e)/g;h[10]=-(k+d)/j;h[11]=-1;h[12]=0;h[13]=0;h[14]=-(2*k*d)/j;h[15]=0;return h},perspective:function(a,b,e,c,d){a=e*Math.tan(a*Math.PI/360);b*=a;return y.frustum(-b,b,-a,a,e,c,d)},ortho:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2/f;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/g;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/j;h[11]=0;h[12]=-(a+b)/f;h[13]=-(c+e)/g;h[14]=-(k+d)/j;h[15]=1;return h},lookAt:function(a,b,e,c){c|| -(c=y.create());var d,k,h,f,g,j,l,m,n=a[0],p=a[1];a=a[2];h=e[0];f=e[1];k=e[2];l=b[0];e=b[1];d=b[2];if(n===l&&p===e&&a===d)return y.identity(c);b=n-l;e=p-e;l=a-d;m=1/Math.sqrt(b*b+e*e+l*l);b*=m;e*=m;l*=m;d=f*l-k*e;k=k*b-h*l;h=h*e-f*b;(m=Math.sqrt(d*d+k*k+h*h))?(m=1/m,d*=m,k*=m,h*=m):h=k=d=0;f=e*h-l*k;g=l*d-b*h;j=b*k-e*d;(m=Math.sqrt(f*f+g*g+j*j))?(m=1/m,f*=m,g*=m,j*=m):j=g=f=0;c[0]=d;c[1]=f;c[2]=b;c[3]=0;c[4]=k;c[5]=g;c[6]=e;c[7]=0;c[8]=h;c[9]=j;c[10]=l;c[11]=0;c[12]=-(d*n+k*p+h*a);c[13]=-(f*n+g*p+ -j*a);c[14]=-(b*n+e*p+l*a);c[15]=1;return c},fromRotationTranslation:function(a,b,e){e||(e=y.create());var c=a[0],d=a[1],k=a[2],h=a[3],f=c+c,g=d+d,j=k+k;a=c*f;var l=c*g,c=c*j,m=d*g,d=d*j,k=k*j,f=h*f,g=h*g,h=h*j;e[0]=1-(m+k);e[1]=l+h;e[2]=c-g;e[3]=0;e[4]=l-h;e[5]=1-(a+k);e[6]=d+f;e[7]=0;e[8]=c+g;e[9]=d-f;e[10]=1-(a+m);e[11]=0;e[12]=b[0];e[13]=b[1];e[14]=b[2];e[15]=1;return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ -a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},s={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,e,c){var d=new l(4);d[0]=a;d[1]=b;d[2]=e;d[3]=c;return d},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=s.create()); -a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},O=s.identity();s.calculateW=function(a,b){var e=a[0],c=a[1],d=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d)),a;b[0]=e;b[1]=c;b[2]=d;b[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d));return b};s.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};s.inverse=function(a,b){var e=a[0],c=a[1],d=a[2],f=a[3],e=(e=e*e+c*c+d*d+f*f)?1/e:0;if(!b||a===b)return a[0]*=-e,a[1]*=-e,a[2]*=-e,a[3]*=e,a;b[0]=-a[0]*e;b[1]=-a[1]*e;b[2]=-a[2]*e;b[3]=a[3]*e; -return b};s.conjugate=function(a,b){if(!b||a===b)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};s.length=function(a){var b=a[0],e=a[1],c=a[2];a=a[3];return Math.sqrt(b*b+e*e+c*c+a*a)};s.normalize=function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],f=a[3],h=Math.sqrt(e*e+c*c+d*d+f*f);if(0===h)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;h=1/h;b[0]=e*h;b[1]=c*h;b[2]=d*h;b[3]=f*h;return b};s.add=function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+= -b[3],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];e[3]=a[3]+b[3];return e};s.multiply=function(a,b,e){e||(e=a);var c=a[0],d=a[1],f=a[2];a=a[3];var h=b[0],g=b[1],j=b[2];b=b[3];e[0]=c*b+a*h+d*j-f*g;e[1]=d*b+a*g+f*h-c*j;e[2]=f*b+a*j+c*g-d*h;e[3]=a*b-c*h-d*g-f*j;return e};s.multiplyVec3=function(a,b,e){e||(e=b);var c=b[0],d=b[1],f=b[2];b=a[0];var h=a[1],g=a[2];a=a[3];var j=a*c+h*f-g*d,l=a*d+g*c-b*f,m=a*f+b*d-h*c,c=-b*c-h*d-g*f;e[0]=j*a+c*-b+l*-g-m*-h;e[1]=l*a+c*-h+m*-b-j*-g;e[2]=m*a+c*-g+j*-h-l*-b; -return e};s.scale=function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a[3]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;e[3]=a[3]*b;return e};s.toMat3=function(a,b){b||(b=F.create());var e=a[0],c=a[1],d=a[2],f=a[3],h=e+e,g=c+c,j=d+d,l=e*h,m=e*g,e=e*j,n=c*g,c=c*j,d=d*j,h=f*h,g=f*g,f=f*j;b[0]=1-(n+d);b[1]=m+f;b[2]=e-g;b[3]=m-f;b[4]=1-(l+d);b[5]=c+h;b[6]=e+g;b[7]=c-h;b[8]=1-(l+n);return b};s.toMat4=function(a,b){b||(b=y.create());var e=a[0],c=a[1],d=a[2],f=a[3],g=e+e,j=c+c,l=d+d,m=e*g,n=e*j,e=e* -l,p=c*j,c=c*l,d=d*l,g=f*g,j=f*j,f=f*l;b[0]=1-(p+d);b[1]=n+f;b[2]=e-j;b[3]=0;b[4]=n-f;b[5]=1-(m+d);b[6]=c+g;b[7]=0;b[8]=e+j;b[9]=c-g;b[10]=1-(m+p);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};s.slerp=function(a,b,c,d){d||(d=a);var f=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],g,h;if(1<=Math.abs(f))return d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d;g=Math.acos(f);h=Math.sqrt(1-f*f);if(0.001>Math.abs(h))return d[0]=0.5*a[0]+0.5*b[0],d[1]=0.5*a[1]+0.5*b[1],d[2]=0.5*a[2]+0.5*b[2],d[3]=0.5*a[3]+ -0.5*b[3],d;f=Math.sin((1-c)*g)/h;c=Math.sin(c*g)/h;d[0]=a[0]*f+b[0]*c;d[1]=a[1]*f+b[1]*c;d[2]=a[2]*f+b[2]*c;d[3]=a[3]*f+b[3]*c;return d};s.fromRotationMatrix=function(a,b){b||(b=s.create());var c=a[0]+a[4]+a[8],d;if(0a[0]&&(c=1);a[8]>a[3*c+c]&&(c=2);var f=d[c],g=d[f];d=Math.sqrt(a[3*c+c]-a[3*f+f]-a[3*g+g]+1);b[c]=0.5*d;d= -0.5/d;b[3]=(a[3*g+f]-a[3*f+g])*d;b[f]=(a[3*f+c]+a[3*c+f])*d;b[g]=(a[3*g+c]+a[3*c+g])*d}return b};F.toQuat4=s.fromRotationMatrix;var D=F.create();s.fromAxes=function(a,b,c,d){D[0]=b[0];D[3]=b[1];D[6]=b[2];D[1]=c[0];D[4]=c[1];D[7]=c[2];D[2]=a[0];D[5]=a[1];D[8]=a[2];return s.fromRotationMatrix(D,d)};s.identity=function(a){a||(a=s.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};s.fromAngleAxis=function(a,b,c){c||(c=s.create());a*=0.5;var d=Math.sin(a);c[3]=Math.cos(a);c[0]=d*b[0];c[1]=d*b[1];c[2]=d*b[2]; -return c};s.toAngleAxis=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); -b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 -Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],f=a[2],g=a[3],h=c*g-f*d;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-d*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, -b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];c[0]=d*b[0]+f*b[2];c[1]=d*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=d*b+f*h;c[1]=d*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var d=b[0];b=b[1];c[0]=d*a[0]+b*a[1];c[1]=d*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var d=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=d*b;c[2]=f*h;c[3]= -g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,d){var f=new l(4);f[0]=a;f[1]=b;f[2]=c;f[3]=d;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, -b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| -(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)},squaredLength:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};c&&(c.glMatrixArrayType=l,c.MatrixArray=l,c.setMatrixArrayType=d,c.determineMatrixArrayType= -f,c.glMath=g,c.vec2=M,c.vec3=j,c.vec4=N,c.mat2=L,c.mat3=F,c.mat4=y,c.quat4=s);return{glMatrixArrayType:l,MatrixArray:l,setMatrixArrayType:d,determineMatrixArrayType:f,glMath:g,vec2:M,vec3:j,vec4:N,mat2:L,mat3:F,mat4:y,quat4:s}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * vColor;","}"]; -PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"]; -PIXI.CompileVertexShader=function(c,d){for(var f="",g=0;g 0) { - this.checkVisibility(child); + this.checkVisibility(child, actualVisibility); } + + }; } -/** - * @private - */ -PIXI.WebGLRenderer.prototype.setGLVisible = function(displayObject, visibility) -{ - var children = displayObject.children; - - for (var i=0; i < children.length; i++) - { - var child = children[i]; - - if(visibility) - { - this.addDisplayObject(child); - } - else - { - this.removeDisplayObject(child); - } - - if(child.children.length > 0) - { - this.setGLVisible(child, visibility); - } - } - -} - /** * Renders the stage to its webGL view - * @param the PIXI.Stage element to be rendered + * @method render + * @param stage {Stage} the PIXI.Stage element to be rendered */ PIXI.WebGLRenderer.prototype.render = function(stage) { @@ -185,9 +164,18 @@ // update children if need be // best to remove first! - for (var i=0; i < stage.__childrenRemoved.length; i++) this.removeDisplayObject(stage.__childrenRemoved[i]); + for (var i=0; i < stage.__childrenRemoved.length; i++) + { + this.removeDisplayObject(stage.__childrenRemoved[i]); + // stage.__childrenRemoved[i].cacheVisible = false; + } + /* // no add all new sprites - for (var i=0; i < stage.__childrenAdded.length; i++) this.addDisplayObject(stage.__childrenAdded[i]); + for (var i=0; i < stage.__childrenAdded.length; i++) + { + stage.__childrenAdded[i].cacheVisible = false; +// this.addDisplayObject(stage.__childrenAdded[i]); + }*/ // update any textures for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]); @@ -197,7 +185,7 @@ PIXI.texturesToUpdate = []; // recursivly loop through all items! - this.checkVisibility(stage); + this.checkVisibility(stage, true); // update the scen graph stage.updateTransform(); @@ -206,7 +194,7 @@ gl.clear(gl.COLOR_BUFFER_BIT) - gl.clearColor(1, 1, 1, 1.0); + gl.clearColor(0, 0, 0, 1.0); // set the correct blend mode! gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); @@ -265,12 +253,16 @@ */ PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject) { - if(!displayObject.stage)return; - displayObject.cacheVisible = displayObject.visible; + if(!displayObject.stage)return; // means it was removed + if(displayObject.__inWebGL)return; //means it is already in webgL - if(!displayObject.visible)return; + //displayObject.cacheVisible = displayObject.visible; + + // TODO if objects parent is not visible then dont add to stage!!!! + //if(!displayObject.visible)return; + displayObject.batch = null; //displayObject.cacheVisible = true; @@ -458,10 +450,12 @@ PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject) { //if(displayObject.stage)return; - displayObject.cacheVisible = displayObject.visible; + displayObject.cacheVisible = false;//displayObject.visible; if(!displayObject.renderable)return; + displayObject.__inWebGL = false; + /* * removing is a lot quicker.. * @@ -472,9 +466,11 @@ { // should always have a batch! var batch = displayObject.batch; - if(!batch)return; // thismeans the display list has been altered befre rendering + if(!batch)return; // this means the display list has been altered befre rendering batch.remove(displayObject); + + if(batch.size==0) { batchToRemove = batch @@ -528,8 +524,9 @@ /** * resizes the webGL view to the specified width and height - * @param the new width of the webGL view - * @param the new height of the webGL view + * @method resize + * @param width {Number} the new width of the webGL view + * @param height {Number} the new height of the webGL view */ PIXI.WebGLRenderer.prototype.resize = function(width, height) { diff --git a/src/pixi/renderers/WebGLShaders.js b/src/pixi/renderers/WebGLShaders.js index 8a109dc..b717256 100644 --- a/src/pixi/renderers/WebGLShaders.js +++ b/src/pixi/renderers/WebGLShaders.js @@ -2,7 +2,6 @@ /** * @author Mat Groves http://matgroves.com/ */ -var PIXI = PIXI || {}; PIXI.shaderFragmentSrc = [ "precision mediump float;", "varying vec2 vTextureCoord;", diff --git a/src/pixi/textures/BaseTexture.js b/src/pixi/textures/BaseTexture.js index 0d2221d..a3fdce7 100644 --- a/src/pixi/textures/BaseTexture.js +++ b/src/pixi/textures/BaseTexture.js @@ -1,17 +1,16 @@ /** * @author Mat Groves http://matgroves.com/ */ -var PIXI = PIXI || {}; PIXI.BaseTextureCache = {}; PIXI.texturesToUpdate = []; /** - * @class A texture stores the information that represents an image. All textures have a base texture - * @augments PIXI.EventTarget + * A texture stores the information that represents an image. All textures have a base texture + * @class BaseTexture + * @extends EventTarget * @constructor - * @param image url - * @return A new BaseTexture + * @param imageUrl {String} image url */ PIXI.BaseTexture = function(imageUrl) { @@ -19,13 +18,15 @@ /** * The url of the texture - * @type #BaseTexture + * @property imageUrl + * @type String */ this.imageUrl = imageUrl; /** * The html image that is loaded to create the texture - * @type #BaseTexture + * @property image + * @type Image */ this.image = new Image(); @@ -41,17 +42,19 @@ scope.dispatchEvent( { type: 'loaded', content: scope } ); } - $.proxy(this.onImageLoaded, this); + $.proxy(this.onImageLoaded, this); this.image.src = imageUrl; /** * [read only] The width of the base texture set when the image has loaded - * @type #BaseTexture + * @property width + * @type Number */ this.width = 100; /** * [read only] The height of the base texture set when the image has loaded - * @type #BaseTexture + * @property height + * @type Number */ this.height = 100; diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/examples/bunny benchmark/index.html b/examples/bunny benchmark/index.html index 7c5521b..95972c4 100644 --- a/examples/bunny benchmark/index.html +++ b/examples/bunny benchmark/index.html @@ -9,9 +9,10 @@ +
    Click to add more bunnys! Let me know how many you get on screen here @doormat23
    - + diff --git a/examples/bunny benchmark/js/bunnyBenchMark.js b/examples/bunny benchmark/js/bunnyBenchMark.js index a3154eb..c3c8ec5 100644 --- a/examples/bunny benchmark/js/bunnyBenchMark.js +++ b/examples/bunny benchmark/js/bunnyBenchMark.js @@ -22,18 +22,13 @@ var count = 0; var container; +var detail; + function onReady() { - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() + detail = document.getElementById("pixi"); - if(webgl) - { - renderer = new PIXI.WebGLRenderer(); - } - else - { - renderer = new PIXI.CanvasRenderer(480, 320); - } + renderer = PIXI.autoDetectRenderer(); stage = new PIXI.Stage; @@ -46,7 +41,7 @@ stats.domElement.style.top = "0px"; requestAnimFrame(update); - wabbitTexture = new PIXI.Texture("wabbit.png") + wabbitTexture = new PIXI.Texture.fromImage("wabbit.png") counter = document.createElement("div"); counter.className = "counter"; @@ -55,7 +50,6 @@ count = startBunnyCount; counter.innerHTML = count + " BUNNIES"; - container = new PIXI.DisplayObjectContainer(); stage.addChild(container); @@ -114,7 +108,9 @@ minX = 0; maxY = height; minY = 0; - + + detail.style.left = width - 204 + "px"; + detail.style.top = height - 100 + "px"; renderer.resize(width, height); } @@ -126,17 +122,17 @@ { // add 10 at a time :) - for (var i = 0; i < 2; i++) + for (var i = 0; i < 10; i++) { - var bunny = new PIXI.Sprite(wabbitTexture, {x:0, y:0, width:26, height:37}); + var bunny = new PIXI.Sprite(wabbitTexture); bunny.speedX = Math.random() * 10; bunny.speedY = (Math.random() * 10) - 5; bunny.anchor.x = 0.5; bunny.anchor.y = 1; - bunny.alpha = 0.3 + Math.random() * 0.7; + //bunny.alpha = 0.3 + Math.random() * 0.7; bunnys.push(bunny); - bunny.rotation = Math.random() - 0.5; + //bunny.rotation = Math.random() - 0.5; container.addChild(bunny); count++; diff --git a/examples/bunny benchmark/js/pixi.js b/examples/bunny benchmark/js/pixi.js new file mode 100644 index 0000000..65add09 --- /dev/null +++ b/examples/bunny benchmark/js/pixi.js @@ -0,0 +1,110 @@ +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, +d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* +j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= +a[0]-d[0],c=a[1]-d[1];a=a[2]-d[2];d=Math.sqrt(b*b+c*c+a*a);if(!d)return j[0]=0,j[1]=0,j[2]=0,j;d=1/d;j[0]=b*d;j[1]=c*d;j[2]=a*d;return j},lerp:function(a,d,j,b){b||(b=a);b[0]=a[0]+j*(d[0]-a[0]);b[1]=a[1]+j*(d[1]-a[1]);b[2]=a[2]+j*(d[2]-a[2]);return b},dist:function(a,d){var j=d[0]-a[0],b=d[1]-a[1],c=d[2]-a[2];return Math.sqrt(j*j+b*b+c*c)}},p=null,q=new k(4);l.unproject=function(a,d,j,b,c){c||(c=a);p||(p=t.create());var e=p;q[0]=2*(a[0]-b[0])/b[2]-1;q[1]=2*(a[1]-b[1])/b[3]-1;q[2]=2*a[2]-1;q[3]=1; +t.multiply(j,d,e);if(!t.inverse(e))return null;t.multiplyVec4(e,q);if(0===q[3])return null;c[0]=q[0]/q[3];c[1]=q[1]/q[3];c[2]=q[2]/q[3];return c};var C=l.createFrom(1,0,0),F=l.createFrom(0,1,0),u=l.createFrom(0,0,1),w=l.create();l.rotationTo=function(a,d,j){j||(j=m.create());var b=l.dot(a,d);if(1<=b)m.set(H,j);else if(-0.999999>b)l.cross(C,a,w),1E-6>l.length(w)&&l.cross(F,a,w),1E-6>l.length(w)&&l.cross(u,a,w),l.normalize(w),m.fromAngleAxis(Math.PI,w,j);else{var b=Math.sqrt(2*(1+b)),c=1/b;l.cross(a, +d,w);j[0]=w[0]*c;j[1]=w[1]*c;j[2]=w[2]*c;j[3]=0.5*b;m.normalize(j)}1j[3]&&(j[3]=-1);return j};l.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var x={create:function(a){var d=new k(9);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8]):d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=0;return d},createFrom:function(a,d,j,b,c,e,n,f,E){var s=new k(9);s[0]=a;s[1]=d;s[2]=j;s[3]=b;s[4]=c;s[5]=e;s[6]=n;s[7]=f;s[8]=E;return s},determinant:function(a){var d= +a[3],j=a[4],b=a[5],c=a[6],e=a[7],n=a[8];return a[0]*(n*j-b*e)+a[1]*(-n*d+b*c)+a[2]*(e*d-j*c)},inverse:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[3],n=a[4],f=a[5],E=a[6],s=a[7],I=a[8],g=I*n-f*s,h=-I*e+f*E,k=s*e-n*E,r=j*g+b*h+c*k;if(!r)return null;r=1/r;d||(d=x.create());d[0]=g*r;d[1]=(-I*b+c*s)*r;d[2]=(f*b-c*n)*r;d[3]=h*r;d[4]=(I*j-c*E)*r;d[5]=(-f*j+c*e)*r;d[6]=k*r;d[7]=(-s*j+b*E)*r;d[8]=(n*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],D=a[4],E=a[5],s=a[6],I= +a[7];a=a[8];var g=d[0],h=d[1],k=d[2],r=d[3],m=d[4],l=d[5],q=d[6],v=d[7];d=d[8];j[0]=g*b+h*f+k*s;j[1]=g*c+h*D+k*I;j[2]=g*e+h*E+k*a;j[3]=r*b+m*f+l*s;j[4]=r*c+m*D+l*I;j[5]=r*e+m*E+l*a;j[6]=q*b+v*f+d*s;j[7]=q*c+v*D+d*I;j[8]=q*e+v*E+d*a;return j},multiplyVec2:function(a,d,j){j||(j=d);var b=d[0];d=d[1];j[0]=b*a[0]+d*a[3]+a[6];j[1]=b*a[1]+d*a[4]+a[7];return j},multiplyVec3:function(a,d,j){j||(j=d);var b=d[0],c=d[1];d=d[2];j[0]=b*a[0]+c*a[3]+d*a[6];j[1]=b*a[1]+c*a[4]+d*a[7];j[2]=b*a[2]+c*a[5]+d*a[8];return j}, +set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])},identity:function(a){a||(a=x.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, +d){if(!d||a===d){var j=a[1],b=a[2],c=a[5];a[1]=a[3];a[2]=a[6];a[3]=j;a[5]=a[7];a[6]=b;a[7]=c;return a}d[0]=a[0];d[1]=a[3];d[2]=a[6];d[3]=a[1];d[4]=a[4];d[5]=a[7];d[6]=a[2];d[7]=a[5];d[8]=a[8];return d},toMat4:function(a,d){d||(d=t.create());d[15]=1;d[14]=0;d[13]=0;d[12]=0;d[11]=0;d[10]=a[8];d[9]=a[7];d[8]=a[6];d[7]=0;d[6]=a[5];d[5]=a[4];d[4]=a[3];d[3]=0;d[2]=a[2];d[1]=a[1];d[0]=a[0];return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ +a[8]+"]"}},t={create:function(a){var d=new k(16);a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8],d[9]=a[9],d[10]=a[10],d[11]=a[11],d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d},createFrom:function(a,d,j,b,c,e,f,D,E,s,g,h,m,l,r,q){var A=new k(16);A[0]=a;A[1]=d;A[2]=j;A[3]=b;A[4]=c;A[5]=e;A[6]=f;A[7]=D;A[8]=E;A[9]=s;A[10]=g;A[11]=h;A[12]=m;A[13]=l;A[14]=r;A[15]=q;return A},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4]; +d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=a[12];d[13]=a[13];d[14]=a[14];d[15]=a[15];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])&&1E-6>Math.abs(a[9]-d[9])&&1E-6>Math.abs(a[10]-d[10])&&1E-6>Math.abs(a[11]-d[11])&&1E-6>Math.abs(a[12]- +d[12])&&1E-6>Math.abs(a[13]-d[13])&&1E-6>Math.abs(a[14]-d[14])&&1E-6>Math.abs(a[15]-d[15])},identity:function(a){a||(a=t.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,d){if(!d||a===d){var j=a[1],b=a[2],c=a[3],e=a[6],f=a[7],D=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=j;a[6]=a[9];a[7]=a[13];a[8]=b;a[9]=e;a[11]=a[14];a[12]=c;a[13]=f;a[14]=D;return a}d[0]=a[0];d[1]=a[4];d[2]=a[8];d[3]=a[12]; +d[4]=a[1];d[5]=a[5];d[6]=a[9];d[7]=a[13];d[8]=a[2];d[9]=a[6];d[10]=a[10];d[11]=a[14];d[12]=a[3];d[13]=a[7];d[14]=a[11];d[15]=a[15];return d},determinant:function(a){var d=a[0],j=a[1],b=a[2],c=a[3],e=a[4],f=a[5],D=a[6],E=a[7],s=a[8],g=a[9],h=a[10],k=a[11],m=a[12],r=a[13],l=a[14];a=a[15];return m*g*D*c-s*r*D*c-m*f*h*c+e*r*h*c+s*f*l*c-e*g*l*c-m*g*b*E+s*r*b*E+m*j*h*E-d*r*h*E-s*j*l*E+d*g*l*E+m*f*b*k-e*r*b*k-m*j*D*k+d*r*D*k+e*j*l*k-d*f*l*k-s*f*b*a+e*g*b*a+s*j*D*a-d*g*D*a-e*j*h*a+d*f*h*a},inverse:function(a, +d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=a[3],f=a[4],D=a[5],E=a[6],s=a[7],g=a[8],h=a[9],k=a[10],m=a[11],r=a[12],l=a[13],A=a[14],q=a[15],v=j*D-b*f,J=j*E-c*f,y=j*s-e*f,z=b*E-c*D,t=b*s-e*D,u=c*s-e*E,p=g*l-h*r,w=g*A-k*r,x=g*q-m*r,B=h*A-k*l,C=h*q-m*l,F=k*q-m*A,G=v*F-J*C+y*B+z*x-t*w+u*p;if(!G)return null;G=1/G;d[0]=(D*F-E*C+s*B)*G;d[1]=(-b*F+c*C-e*B)*G;d[2]=(l*u-A*t+q*z)*G;d[3]=(-h*u+k*t-m*z)*G;d[4]=(-f*F+E*x-s*w)*G;d[5]=(j*F-c*x+e*w)*G;d[6]=(-r*u+A*y-q*J)*G;d[7]=(g*u-k*y+m*J)*G;d[8]=(f*C-D*x+s*p)*G;d[9]= +(-j*C+b*x-e*p)*G;d[10]=(r*t-l*y+q*v)*G;d[11]=(-g*t+h*y-m*v)*G;d[12]=(-f*B+D*w-E*p)*G;d[13]=(j*B-b*w+c*p)*G;d[14]=(-r*z+l*J-A*v)*G;d[15]=(g*z-h*J+k*v)*G;return d},toRotationMat:function(a,d){d||(d=t.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d},toMat3:function(a,d){d||(d=x.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[4];d[4]=a[5];d[5]=a[6];d[6]=a[8];d[7]=a[9];d[8]=a[10]; +return d},toInverseMat3:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[4],f=a[5],D=a[6],g=a[8],s=a[9],h=a[10],k=h*f-D*s,m=-h*e+D*g,l=s*e-f*g,r=j*k+b*m+c*l;if(!r)return null;r=1/r;d||(d=x.create());d[0]=k*r;d[1]=(-h*b+c*s)*r;d[2]=(D*b-c*f)*r;d[3]=m*r;d[4]=(h*j-c*g)*r;d[5]=(-D*j+c*e)*r;d[6]=l*r;d[7]=(-s*j+b*g)*r;d[8]=(f*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],s=a[6],k=a[7],m=a[8],l=a[9],q=a[10],r=a[11],t=a[12],A=a[13],u=a[14];a=a[15];var v=d[0], +p=d[1],y=d[2],z=d[3];j[0]=v*b+p*g+y*m+z*t;j[1]=v*c+p*h+y*l+z*A;j[2]=v*e+p*s+y*q+z*u;j[3]=v*f+p*k+y*r+z*a;v=d[4];p=d[5];y=d[6];z=d[7];j[4]=v*b+p*g+y*m+z*t;j[5]=v*c+p*h+y*l+z*A;j[6]=v*e+p*s+y*q+z*u;j[7]=v*f+p*k+y*r+z*a;v=d[8];p=d[9];y=d[10];z=d[11];j[8]=v*b+p*g+y*m+z*t;j[9]=v*c+p*h+y*l+z*A;j[10]=v*e+p*s+y*q+z*u;j[11]=v*f+p*k+y*r+z*a;v=d[12];p=d[13];y=d[14];z=d[15];j[12]=v*b+p*g+y*m+z*t;j[13]=v*c+p*h+y*l+z*A;j[14]=v*e+p*s+y*q+z*u;j[15]=v*f+p*k+y*r+z*a;return j},multiplyVec3:function(a,d,b){b||(b=d); +var c=d[0],e=d[1];d=d[2];b[0]=a[0]*c+a[4]*e+a[8]*d+a[12];b[1]=a[1]*c+a[5]*e+a[9]*d+a[13];b[2]=a[2]*c+a[6]*e+a[10]*d+a[14];return b},multiplyVec4:function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=d[3];b[0]=a[0]*c+a[4]*e+a[8]*f+a[12]*d;b[1]=a[1]*c+a[5]*e+a[9]*f+a[13]*d;b[2]=a[2]*c+a[6]*e+a[10]*f+a[14]*d;b[3]=a[3]*c+a[7]*e+a[11]*f+a[15]*d;return b},translate:function(a,d,b){var c=d[0],e=d[1];d=d[2];var f,n,g,h,s,k,m,l,p,r,q,t;if(!b||a===b)return a[12]=a[0]*c+a[4]*e+a[8]*d+a[12],a[13]=a[1]*c+a[5]*e+ +a[9]*d+a[13],a[14]=a[2]*c+a[6]*e+a[10]*d+a[14],a[15]=a[3]*c+a[7]*e+a[11]*d+a[15],a;f=a[0];n=a[1];g=a[2];h=a[3];s=a[4];k=a[5];m=a[6];l=a[7];p=a[8];r=a[9];q=a[10];t=a[11];b[0]=f;b[1]=n;b[2]=g;b[3]=h;b[4]=s;b[5]=k;b[6]=m;b[7]=l;b[8]=p;b[9]=r;b[10]=q;b[11]=t;b[12]=f*c+s*e+p*d+a[12];b[13]=n*c+k*e+r*d+a[13];b[14]=g*c+m*e+q*d+a[14];b[15]=h*c+l*e+t*d+a[15];return b},scale:function(a,d,b){var c=d[0],e=d[1];d=d[2];if(!b||a===b)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=d,a[9]*= +d,a[10]*=d,a[11]*=d,a;b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[7]=a[7]*e;b[8]=a[8]*d;b[9]=a[9]*d;b[10]=a[10]*d;b[11]=a[11]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},rotate:function(a,d,b,c){var e=b[0],f=b[1];b=b[2];var n=Math.sqrt(e*e+f*f+b*b),g,h,k,m,l,p,q,r,t,u,w,v,x,y,z,B,C,F,H,K;if(!n)return null;1!==n&&(n=1/n,e*=n,f*=n,b*=n);g=Math.sin(d);h=Math.cos(d);k=1-h;d=a[0];n=a[1];m=a[2];l=a[3];p=a[4];q=a[5];r=a[6];t=a[7];u=a[8];w=a[9];v= +a[10];x=a[11];y=e*e*k+h;z=f*e*k+b*g;B=b*e*k-f*g;C=e*f*k-b*g;F=f*f*k+h;H=b*f*k+e*g;K=e*b*k+f*g;e=f*b*k-e*g;f=b*b*k+h;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=d*y+p*z+u*B;c[1]=n*y+q*z+w*B;c[2]=m*y+r*z+v*B;c[3]=l*y+t*z+x*B;c[4]=d*C+p*F+u*H;c[5]=n*C+q*F+w*H;c[6]=m*C+r*F+v*H;c[7]=l*C+t*F+x*H;c[8]=d*K+p*e+u*f;c[9]=n*K+q*e+w*f;c[10]=m*K+r*e+v*f;c[11]=l*K+t*e+x*f;return c},rotateX:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[4],f=a[5],n=a[6],g=a[7],h=a[8],k=a[9],m=a[10], +l=a[11];b?a!==b&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[4]=e*d+h*c;b[5]=f*d+k*c;b[6]=n*d+m*c;b[7]=g*d+l*c;b[8]=e*-c+h*d;b[9]=f*-c+k*d;b[10]=n*-c+m*d;b[11]=g*-c+l*d;return b},rotateY:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[8],k=a[9],m=a[10],l=a[11];b?a!==b&&(b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*-c;b[1]=f*d+k*-c;b[2]=n*d+m*-c;b[3]=g* +d+l*-c;b[8]=e*c+h*d;b[9]=f*c+k*d;b[10]=n*c+m*d;b[11]=g*c+l*d;return b},rotateZ:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[4],k=a[5],m=a[6],l=a[7];b?a!==b&&(b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*c;b[1]=f*d+k*c;b[2]=n*d+m*c;b[3]=g*d+l*c;b[4]=e*-c+h*d;b[5]=f*-c+k*d;b[6]=n*-c+m*d;b[7]=g*-c+l*d;return b},frustum:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2*e/g;n[1]=0; +n[2]=0;n[3]=0;n[4]=0;n[5]=2*e/h;n[6]=0;n[7]=0;n[8]=(d+a)/g;n[9]=(c+b)/h;n[10]=-(f+e)/k;n[11]=-1;n[12]=0;n[13]=0;n[14]=-(2*f*e)/k;n[15]=0;return n},perspective:function(a,d,b,c,e){a=b*Math.tan(a*Math.PI/360);d*=a;return t.frustum(-d,d,-a,a,b,c,e)},ortho:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2/g;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=2/h;n[6]=0;n[7]=0;n[8]=0;n[9]=0;n[10]=-2/k;n[11]=0;n[12]=-(a+d)/g;n[13]=-(c+b)/h;n[14]=-(f+e)/k;n[15]=1;return n},lookAt:function(a,d,b,c){c|| +(c=t.create());var e,f,n,g,h,k,m,l,p=a[0],q=a[1];a=a[2];n=b[0];g=b[1];f=b[2];m=d[0];b=d[1];e=d[2];if(p===m&&q===b&&a===e)return t.identity(c);d=p-m;b=q-b;m=a-e;l=1/Math.sqrt(d*d+b*b+m*m);d*=l;b*=l;m*=l;e=g*m-f*b;f=f*d-n*m;n=n*b-g*d;(l=Math.sqrt(e*e+f*f+n*n))?(l=1/l,e*=l,f*=l,n*=l):n=f=e=0;g=b*n-m*f;h=m*e-d*n;k=d*f-b*e;(l=Math.sqrt(g*g+h*h+k*k))?(l=1/l,g*=l,h*=l,k*=l):k=h=g=0;c[0]=e;c[1]=g;c[2]=d;c[3]=0;c[4]=f;c[5]=h;c[6]=b;c[7]=0;c[8]=n;c[9]=k;c[10]=m;c[11]=0;c[12]=-(e*p+f*q+n*a);c[13]=-(g*p+h*q+ +k*a);c[14]=-(d*p+b*q+m*a);c[15]=1;return c},fromRotationTranslation:function(a,d,b){b||(b=t.create());var c=a[0],e=a[1],f=a[2],n=a[3],g=c+c,h=e+e,k=f+f;a=c*g;var l=c*h,c=c*k,m=e*h,e=e*k,f=f*k,g=n*g,h=n*h,n=n*k;b[0]=1-(m+f);b[1]=l+n;b[2]=c-h;b[3]=0;b[4]=l-n;b[5]=1-(a+f);b[6]=e+g;b[7]=0;b[8]=c+h;b[9]=e-g;b[10]=1-(a+m);b[11]=0;b[12]=d[0];b[13]=d[1];b[14]=d[2];b[15]=1;return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ +a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},m={create:function(a){var d=new k(4);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]):d[0]=d[1]=d[2]=d[3]=0;return d},createFrom:function(a,d,b,c){var e=new k(4);e[0]=a;e[1]=d;e[2]=b;e[3]=c;return e},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])},identity:function(a){a||(a=m.create()); +a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},H=m.identity();m.calculateW=function(a,d){var b=a[0],c=a[1],e=a[2];if(!d||a===d)return a[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e)),a;d[0]=b;d[1]=c;d[2]=e;d[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e));return d};m.dot=function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3]};m.inverse=function(a,d){var b=a[0],c=a[1],e=a[2],f=a[3],b=(b=b*b+c*c+e*e+f*f)?1/b:0;if(!d||a===d)return a[0]*=-b,a[1]*=-b,a[2]*=-b,a[3]*=b,a;d[0]=-a[0]*b;d[1]=-a[1]*b;d[2]=-a[2]*b;d[3]=a[3]*b; +return d};m.conjugate=function(a,d){if(!d||a===d)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=a[3];return d};m.length=function(a){var d=a[0],b=a[1],c=a[2];a=a[3];return Math.sqrt(d*d+b*b+c*c+a*a)};m.normalize=function(a,d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=Math.sqrt(b*b+c*c+e*e+f*f);if(0===g)return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d;g=1/g;d[0]=b*g;d[1]=c*g;d[2]=e*g;d[3]=f*g;return d};m.add=function(a,d,b){if(!b||a===b)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a[3]+= +d[3],a;b[0]=a[0]+d[0];b[1]=a[1]+d[1];b[2]=a[2]+d[2];b[3]=a[3]+d[3];return b};m.multiply=function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2];a=a[3];var g=d[0],h=d[1],k=d[2];d=d[3];b[0]=c*d+a*g+e*k-f*h;b[1]=e*d+a*h+f*g-c*k;b[2]=f*d+a*k+c*h-e*g;b[3]=a*d-c*g-e*h-f*k;return b};m.multiplyVec3=function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=a[0];var g=a[1],h=a[2];a=a[3];var k=a*c+g*f-h*e,l=a*e+h*c-d*f,m=a*f+d*e-g*c,c=-d*c-g*e-h*f;b[0]=k*a+c*-d+l*-h-m*-g;b[1]=l*a+c*-g+m*-d-k*-h;b[2]=m*a+c*-h+k*-g-l*-d; +return b};m.scale=function(a,d,b){if(!b||a===b)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a;b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[3]=a[3]*d;return b};m.toMat3=function(a,d){d||(d=x.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b*k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=m-f;d[4]=1-(l+e);d[5]=c+g;d[6]=b+h;d[7]=c-g;d[8]=1-(l+p);return d};m.toMat4=function(a,d){d||(d=t.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b* +k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=0;d[4]=m-f;d[5]=1-(l+e);d[6]=c+g;d[7]=0;d[8]=b+h;d[9]=c-g;d[10]=1-(l+p);d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d};m.slerp=function(a,d,b,c){c||(c=a);var e=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3],f,g;if(1<=Math.abs(e))return c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]),c;f=Math.acos(e);g=Math.sqrt(1-e*e);if(0.0010>Math.abs(g))return c[0]=0.5*a[0]+0.5*d[0],c[1]=0.5*a[1]+0.5*d[1],c[2]=0.5*a[2]+0.5*d[2],c[3]=0.5*a[3]+ +0.5*d[3],c;e=Math.sin((1-b)*f)/g;b=Math.sin(b*f)/g;c[0]=a[0]*e+d[0]*b;c[1]=a[1]*e+d[1]*b;c[2]=a[2]*e+d[2]*b;c[3]=a[3]*e+d[3]*b;return c};m.fromRotationMatrix=function(a,d){d||(d=m.create());var b=a[0]+a[4]+a[8],c;if(0a[0]&&(b=1);a[8]>a[3*b+b]&&(b=2);var e=c[b],f=c[e];c=Math.sqrt(a[3*b+b]-a[3*e+e]-a[3*f+f]+1);d[b]=0.5*c;c= +0.5/c;d[3]=(a[3*f+e]-a[3*e+f])*c;d[e]=(a[3*e+b]+a[3*b+e])*c;d[f]=(a[3*f+b]+a[3*b+f])*c}return d};x.toQuat4=m.fromRotationMatrix;var B=x.create();m.fromAxes=function(a,d,b,c){B[0]=d[0];B[3]=d[1];B[6]=d[2];B[1]=b[0];B[4]=b[1];B[7]=b[2];B[2]=a[0];B[5]=a[1];B[8]=a[2];return m.fromRotationMatrix(B,c)};m.identity=function(a){a||(a=m.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};m.fromAngleAxis=function(a,d,b){b||(b=m.create());a*=0.5;var c=Math.sin(a);b[3]=Math.cos(a);b[0]=c*d[0];b[1]=c*d[1];b[2]=c*d[2]; +return b};m.toAngleAxis=function(a,d){d||(d=a);var b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); +b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 +Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],e=a[1],f=a[2],g=a[3],h=c*g-f*e;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-e*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, +b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];c[0]=e*b[0]+f*b[2];c[1]=e*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=e*b+f*h;c[1]=e*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var e=b[0];b=b[1];c[0]=e*a[0]+b*a[1];c[1]=e*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var e=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=e*b;c[2]=f*h;c[3]= +g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, +b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| +(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= +f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; +PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; +PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l>1);var b=m[0];return b*(1.5-0.5*a*b*b)}}else g.invsqrt=function(a){return 1/Math.sqrt(a)}; -var l=null;f();var j={create:function(a){var b=new l(3);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0;return b},createFrom:function(a,b,e){var c=new l(3);c[0]=a;c[1]=b;c[2]=e;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])},add:function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];return e},subtract:function(a, -b,e){if(!e||a===e)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];return e},multiply:function(a,b,e){if(!e||a===e)return a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a;e[0]=a[0]*b[0];e[1]=a[1]*b[1];e[2]=a[2]*b[2];return e},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;return e},normalize:function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=Math.sqrt(e* -e+c*c+d*d);if(!k)return b[0]=0,b[1]=0,b[2]=0,b;if(1===k)return b[0]=e,b[1]=c,b[2]=d,b;k=1/k;b[0]=e*k;b[1]=c*k;b[2]=d*k;return b},cross:function(a,b,e){e||(e=a);var c=a[0],d=a[1];a=a[2];var k=b[0],h=b[1];b=b[2];e[0]=d*b-a*h;e[1]=a*k-c*b;e[2]=c*h-d*k;return e},length:function(a){var b=a[0],e=a[1];a=a[2];return Math.sqrt(b*b+e*e+a*a)},squaredLength:function(a){var b=a[0],e=a[1];a=a[2];return b*b+e*e+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,b,e){e||(e=a);var c= -a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];b=Math.sqrt(c*c+d*d+a*a);if(!b)return e[0]=0,e[1]=0,e[2]=0,e;b=1/b;e[0]=c*b;e[1]=d*b;e[2]=a*b;return e},lerp:function(a,b,e,c){c||(c=a);c[0]=a[0]+e*(b[0]-a[0]);c[1]=a[1]+e*(b[1]-a[1]);c[2]=a[2]+e*(b[2]-a[2]);return c},dist:function(a,b){var e=b[0]-a[0],c=b[1]-a[1],d=b[2]-a[2];return Math.sqrt(e*e+c*c+d*d)}},x=null,n=new l(4);j.unproject=function(a,b,e,c,d){d||(d=a);x||(x=y.create());var k=x;n[0]=2*(a[0]-c[0])/c[2]-1;n[1]=2*(a[1]-c[1])/c[3]-1;n[2]=2*a[2]-1;n[3]=1; -y.multiply(e,b,k);if(!y.inverse(k))return null;y.multiplyVec4(k,n);if(0===n[3])return null;d[0]=n[0]/n[3];d[1]=n[1]/n[3];d[2]=n[2]/n[3];return d};var z=j.createFrom(1,0,0),A=j.createFrom(0,1,0),H=j.createFrom(0,0,1),C=j.create();j.rotationTo=function(a,b,e){e||(e=s.create());var c=j.dot(a,b);if(1<=c)s.set(O,e);else if(-0.999999>c)j.cross(z,a,C),1E-6>j.length(C)&&j.cross(A,a,C),1E-6>j.length(C)&&j.cross(H,a,C),j.normalize(C),s.fromAngleAxis(Math.PI,C,e);else{var c=Math.sqrt(2*(1+c)),d=1/c;j.cross(a, -b,C);e[0]=C[0]*d;e[1]=C[1]*d;e[2]=C[2]*d;e[3]=0.5*c;s.normalize(e)}1e[3]&&(e[3]=-1);return e};j.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var F={create:function(a){var b=new l(9);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0;return b},createFrom:function(a,b,e,c,d,k,h,E,K){var q=new l(9);q[0]=a;q[1]=b;q[2]=e;q[3]=c;q[4]=d;q[5]=k;q[6]=h;q[7]=E;q[8]=K;return q},determinant:function(a){var b= -a[3],e=a[4],c=a[5],d=a[6],k=a[7],h=a[8];return a[0]*(h*e-c*k)+a[1]*(-h*b+c*d)+a[2]*(k*b-e*d)},inverse:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],E=a[5],K=a[6],q=a[7],f=a[8],g=f*h-E*q,j=-f*k+E*K,J=q*k-h*K,r=e*g+c*j+d*J;if(!r)return null;r=1/r;b||(b=F.create());b[0]=g*r;b[1]=(-f*c+d*q)*r;b[2]=(E*c-d*h)*r;b[3]=j*r;b[4]=(f*e-d*K)*r;b[5]=(-E*e+d*k)*r;b[6]=J*r;b[7]=(-q*e+c*K)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],E=a[4],f=a[5],q=a[6],g= -a[7];a=a[8];var u=b[0],j=b[1],J=b[2],r=b[3],l=b[4],t=b[5],m=b[6],p=b[7];b=b[8];e[0]=u*c+j*h+J*q;e[1]=u*d+j*E+J*g;e[2]=u*k+j*f+J*a;e[3]=r*c+l*h+t*q;e[4]=r*d+l*E+t*g;e[5]=r*k+l*f+t*a;e[6]=m*c+p*h+b*q;e[7]=m*d+p*E+b*g;e[8]=m*k+p*f+b*a;return e},multiplyVec2:function(a,b,e){e||(e=b);var c=b[0];b=b[1];e[0]=c*a[0]+b*a[3]+a[6];e[1]=c*a[1]+b*a[4]+a[7];return e},multiplyVec3:function(a,b,e){e||(e=b);var c=b[0],d=b[1];b=b[2];e[0]=c*a[0]+d*a[3]+b*a[6];e[1]=c*a[1]+d*a[4]+b*a[7];e[2]=c*a[2]+d*a[5]+b*a[8];return e}, -set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])},identity:function(a){a||(a=F.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, -b){if(!b||a===b){var e=a[1],c=a[2],d=a[5];a[1]=a[3];a[2]=a[6];a[3]=e;a[5]=a[7];a[6]=c;a[7]=d;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]=a[8];return b},toMat4:function(a,b){b||(b=y.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ -a[8]+"]"}},y={create:function(a){var b=new l(16);a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]);return b},createFrom:function(a,b,e,c,d,k,h,E,f,q,g,u,j,J,r,m){var t=new l(16);t[0]=a;t[1]=b;t[2]=e;t[3]=c;t[4]=d;t[5]=k;t[6]=h;t[7]=E;t[8]=f;t[9]=q;t[10]=g;t[11]=u;t[12]=j;t[13]=J;t[14]=r;t[15]=m;return t},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4]; -b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])&&1E-6>Math.abs(a[9]-b[9])&&1E-6>Math.abs(a[10]-b[10])&&1E-6>Math.abs(a[11]-b[11])&&1E-6>Math.abs(a[12]- -b[12])&&1E-6>Math.abs(a[13]-b[13])&&1E-6>Math.abs(a[14]-b[14])&&1E-6>Math.abs(a[15]-b[15])},identity:function(a){a||(a=y.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){var e=a[1],c=a[2],d=a[3],k=a[6],h=a[7],E=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=e;a[6]=a[9];a[7]=a[13];a[8]=c;a[9]=k;a[11]=a[14];a[12]=d;a[13]=h;a[14]=E;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12]; -b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b=a[0],e=a[1],c=a[2],d=a[3],k=a[4],h=a[5],E=a[6],f=a[7],g=a[8],I=a[9],u=a[10],j=a[11],l=a[12],r=a[13],m=a[14];a=a[15];return l*I*E*d-g*r*E*d-l*h*u*d+k*r*u*d+g*h*m*d-k*I*m*d-l*I*c*f+g*r*c*f+l*e*u*f-b*r*u*f-g*e*m*f+b*I*m*f+l*h*c*j-k*r*c*j-l*e*E*j+b*r*E*j+k*e*m*j-b*h*m*j-g*h*c*a+k*I*c*a+g*e*E*a-b*I*E*a-k*e*u*a+b*h*u*a},inverse:function(a, -b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],f=a[5],g=a[6],q=a[7],I=a[8],u=a[9],j=a[10],l=a[11],r=a[12],m=a[13],t=a[14],p=a[15],s=e*f-c*h,n=e*g-d*h,v=e*q-k*h,w=c*g-d*f,x=c*q-k*f,y=d*q-k*g,z=I*m-u*r,A=I*t-j*r,C=I*p-l*r,D=u*t-j*m,F=u*p-l*m,H=j*p-l*t,G=s*H-n*F+v*D+w*C-x*A+y*z;if(!G)return null;G=1/G;b[0]=(f*H-g*F+q*D)*G;b[1]=(-c*H+d*F-k*D)*G;b[2]=(m*y-t*x+p*w)*G;b[3]=(-u*y+j*x-l*w)*G;b[4]=(-h*H+g*C-q*A)*G;b[5]=(e*H-d*C+k*A)*G;b[6]=(-r*y+t*v-p*n)*G;b[7]=(I*y-j*v+l*n)*G;b[8]=(h*F-f*C+q*z)*G;b[9]= -(-e*F+c*C-k*z)*G;b[10]=(r*x-m*v+p*s)*G;b[11]=(-I*x+u*v-l*s)*G;b[12]=(-h*D+f*A-g*z)*G;b[13]=(e*D-c*A+d*z)*G;b[14]=(-r*w+m*n-t*s)*G;b[15]=(I*w-u*n+j*s)*G;return b},toRotationMat:function(a,b){b||(b=y.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=F.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10]; -return b},toInverseMat3:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[4],h=a[5],f=a[6],g=a[8],q=a[9],j=a[10],u=j*h-f*q,l=-j*k+f*g,m=q*k-h*g,r=e*u+c*l+d*m;if(!r)return null;r=1/r;b||(b=F.create());b[0]=u*r;b[1]=(-j*c+d*q)*r;b[2]=(f*c-d*h)*r;b[3]=l*r;b[4]=(j*e-d*g)*r;b[5]=(-f*e+d*k)*r;b[6]=m*r;b[7]=(-q*e+c*g)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],f=a[4],g=a[5],q=a[6],j=a[7],u=a[8],l=a[9],m=a[10],r=a[11],p=a[12],t=a[13],s=a[14];a=a[15];var n=b[0], -B=b[1],v=b[2],w=b[3];e[0]=n*c+B*f+v*u+w*p;e[1]=n*d+B*g+v*l+w*t;e[2]=n*k+B*q+v*m+w*s;e[3]=n*h+B*j+v*r+w*a;n=b[4];B=b[5];v=b[6];w=b[7];e[4]=n*c+B*f+v*u+w*p;e[5]=n*d+B*g+v*l+w*t;e[6]=n*k+B*q+v*m+w*s;e[7]=n*h+B*j+v*r+w*a;n=b[8];B=b[9];v=b[10];w=b[11];e[8]=n*c+B*f+v*u+w*p;e[9]=n*d+B*g+v*l+w*t;e[10]=n*k+B*q+v*m+w*s;e[11]=n*h+B*j+v*r+w*a;n=b[12];B=b[13];v=b[14];w=b[15];e[12]=n*c+B*f+v*u+w*p;e[13]=n*d+B*g+v*l+w*t;e[14]=n*k+B*q+v*m+w*s;e[15]=n*h+B*j+v*r+w*a;return e},multiplyVec3:function(a,b,e){e||(e=b); -var c=b[0],d=b[1];b=b[2];e[0]=a[0]*c+a[4]*d+a[8]*b+a[12];e[1]=a[1]*c+a[5]*d+a[9]*b+a[13];e[2]=a[2]*c+a[6]*d+a[10]*b+a[14];return e},multiplyVec4:function(a,b,e){e||(e=b);var c=b[0],d=b[1],k=b[2];b=b[3];e[0]=a[0]*c+a[4]*d+a[8]*k+a[12]*b;e[1]=a[1]*c+a[5]*d+a[9]*k+a[13]*b;e[2]=a[2]*c+a[6]*d+a[10]*k+a[14]*b;e[3]=a[3]*c+a[7]*d+a[11]*k+a[15]*b;return e},translate:function(a,b,e){var c=b[0],d=b[1];b=b[2];var k,h,f,g,q,j,u,l,m,n,p,s;if(!e||a===e)return a[12]=a[0]*c+a[4]*d+a[8]*b+a[12],a[13]=a[1]*c+a[5]*d+ -a[9]*b+a[13],a[14]=a[2]*c+a[6]*d+a[10]*b+a[14],a[15]=a[3]*c+a[7]*d+a[11]*b+a[15],a;k=a[0];h=a[1];f=a[2];g=a[3];q=a[4];j=a[5];u=a[6];l=a[7];m=a[8];n=a[9];p=a[10];s=a[11];e[0]=k;e[1]=h;e[2]=f;e[3]=g;e[4]=q;e[5]=j;e[6]=u;e[7]=l;e[8]=m;e[9]=n;e[10]=p;e[11]=s;e[12]=k*c+q*d+m*b+a[12];e[13]=h*c+j*d+n*b+a[13];e[14]=f*c+u*d+p*b+a[14];e[15]=g*c+l*d+s*b+a[15];return e},scale:function(a,b,e){var c=b[0],d=b[1];b=b[2];if(!e||a===e)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=d,a[5]*=d,a[6]*=d,a[7]*=d,a[8]*=b,a[9]*= -b,a[10]*=b,a[11]*=b,a;e[0]=a[0]*c;e[1]=a[1]*c;e[2]=a[2]*c;e[3]=a[3]*c;e[4]=a[4]*d;e[5]=a[5]*d;e[6]=a[6]*d;e[7]=a[7]*d;e[8]=a[8]*b;e[9]=a[9]*b;e[10]=a[10]*b;e[11]=a[11]*b;e[12]=a[12];e[13]=a[13];e[14]=a[14];e[15]=a[15];return e},rotate:function(a,b,e,c){var d=e[0],k=e[1];e=e[2];var h=Math.sqrt(d*d+k*k+e*e),f,g,q,j,l,m,n,r,p,s,x,y,B,v,w,z,A,C,D,F;if(!h)return null;1!==h&&(h=1/h,d*=h,k*=h,e*=h);f=Math.sin(b);g=Math.cos(b);q=1-g;b=a[0];h=a[1];j=a[2];l=a[3];m=a[4];n=a[5];r=a[6];p=a[7];s=a[8];x=a[9];y= -a[10];B=a[11];v=d*d*q+g;w=k*d*q+e*f;z=e*d*q-k*f;A=d*k*q-e*f;C=k*k*q+g;D=e*k*q+d*f;F=d*e*q+k*f;d=k*e*q-d*f;k=e*e*q+g;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=b*v+m*w+s*z;c[1]=h*v+n*w+x*z;c[2]=j*v+r*w+y*z;c[3]=l*v+p*w+B*z;c[4]=b*A+m*C+s*D;c[5]=h*A+n*C+x*D;c[6]=j*A+r*C+y*D;c[7]=l*A+p*C+B*D;c[8]=b*F+m*d+s*k;c[9]=h*F+n*d+x*k;c[10]=j*F+r*d+y*k;c[11]=l*F+p*d+B*k;return c},rotateX:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[4],k=a[5],h=a[6],f=a[7],g=a[8],q=a[9],j=a[10], -l=a[11];e?a!==e&&(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[4]=d*b+g*c;e[5]=k*b+q*c;e[6]=h*b+j*c;e[7]=f*b+l*c;e[8]=d*-c+g*b;e[9]=k*-c+q*b;e[10]=h*-c+j*b;e[11]=f*-c+l*b;return e},rotateY:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[8],j=a[9],l=a[10],m=a[11];e?a!==e&&(e[4]=a[4],e[5]=a[5],e[6]=a[6],e[7]=a[7],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*-c;e[1]=k*b+j*-c;e[2]=h*b+l*-c;e[3]=f* -b+m*-c;e[8]=d*c+g*b;e[9]=k*c+j*b;e[10]=h*c+l*b;e[11]=f*c+m*b;return e},rotateZ:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[4],j=a[5],l=a[6],m=a[7];e?a!==e&&(e[8]=a[8],e[9]=a[9],e[10]=a[10],e[11]=a[11],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*c;e[1]=k*b+j*c;e[2]=h*b+l*c;e[3]=f*b+m*c;e[4]=d*-c+g*b;e[5]=k*-c+j*b;e[6]=h*-c+l*b;e[7]=f*-c+m*b;return e},frustum:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2*d/f;h[1]=0; -h[2]=0;h[3]=0;h[4]=0;h[5]=2*d/g;h[6]=0;h[7]=0;h[8]=(b+a)/f;h[9]=(c+e)/g;h[10]=-(k+d)/j;h[11]=-1;h[12]=0;h[13]=0;h[14]=-(2*k*d)/j;h[15]=0;return h},perspective:function(a,b,e,c,d){a=e*Math.tan(a*Math.PI/360);b*=a;return y.frustum(-b,b,-a,a,e,c,d)},ortho:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2/f;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/g;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/j;h[11]=0;h[12]=-(a+b)/f;h[13]=-(c+e)/g;h[14]=-(k+d)/j;h[15]=1;return h},lookAt:function(a,b,e,c){c|| -(c=y.create());var d,k,h,f,g,j,l,m,n=a[0],p=a[1];a=a[2];h=e[0];f=e[1];k=e[2];l=b[0];e=b[1];d=b[2];if(n===l&&p===e&&a===d)return y.identity(c);b=n-l;e=p-e;l=a-d;m=1/Math.sqrt(b*b+e*e+l*l);b*=m;e*=m;l*=m;d=f*l-k*e;k=k*b-h*l;h=h*e-f*b;(m=Math.sqrt(d*d+k*k+h*h))?(m=1/m,d*=m,k*=m,h*=m):h=k=d=0;f=e*h-l*k;g=l*d-b*h;j=b*k-e*d;(m=Math.sqrt(f*f+g*g+j*j))?(m=1/m,f*=m,g*=m,j*=m):j=g=f=0;c[0]=d;c[1]=f;c[2]=b;c[3]=0;c[4]=k;c[5]=g;c[6]=e;c[7]=0;c[8]=h;c[9]=j;c[10]=l;c[11]=0;c[12]=-(d*n+k*p+h*a);c[13]=-(f*n+g*p+ -j*a);c[14]=-(b*n+e*p+l*a);c[15]=1;return c},fromRotationTranslation:function(a,b,e){e||(e=y.create());var c=a[0],d=a[1],k=a[2],h=a[3],f=c+c,g=d+d,j=k+k;a=c*f;var l=c*g,c=c*j,m=d*g,d=d*j,k=k*j,f=h*f,g=h*g,h=h*j;e[0]=1-(m+k);e[1]=l+h;e[2]=c-g;e[3]=0;e[4]=l-h;e[5]=1-(a+k);e[6]=d+f;e[7]=0;e[8]=c+g;e[9]=d-f;e[10]=1-(a+m);e[11]=0;e[12]=b[0];e[13]=b[1];e[14]=b[2];e[15]=1;return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ -a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},s={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,e,c){var d=new l(4);d[0]=a;d[1]=b;d[2]=e;d[3]=c;return d},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=s.create()); -a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},O=s.identity();s.calculateW=function(a,b){var e=a[0],c=a[1],d=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d)),a;b[0]=e;b[1]=c;b[2]=d;b[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d));return b};s.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};s.inverse=function(a,b){var e=a[0],c=a[1],d=a[2],f=a[3],e=(e=e*e+c*c+d*d+f*f)?1/e:0;if(!b||a===b)return a[0]*=-e,a[1]*=-e,a[2]*=-e,a[3]*=e,a;b[0]=-a[0]*e;b[1]=-a[1]*e;b[2]=-a[2]*e;b[3]=a[3]*e; -return b};s.conjugate=function(a,b){if(!b||a===b)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};s.length=function(a){var b=a[0],e=a[1],c=a[2];a=a[3];return Math.sqrt(b*b+e*e+c*c+a*a)};s.normalize=function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],f=a[3],h=Math.sqrt(e*e+c*c+d*d+f*f);if(0===h)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;h=1/h;b[0]=e*h;b[1]=c*h;b[2]=d*h;b[3]=f*h;return b};s.add=function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+= -b[3],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];e[3]=a[3]+b[3];return e};s.multiply=function(a,b,e){e||(e=a);var c=a[0],d=a[1],f=a[2];a=a[3];var h=b[0],g=b[1],j=b[2];b=b[3];e[0]=c*b+a*h+d*j-f*g;e[1]=d*b+a*g+f*h-c*j;e[2]=f*b+a*j+c*g-d*h;e[3]=a*b-c*h-d*g-f*j;return e};s.multiplyVec3=function(a,b,e){e||(e=b);var c=b[0],d=b[1],f=b[2];b=a[0];var h=a[1],g=a[2];a=a[3];var j=a*c+h*f-g*d,l=a*d+g*c-b*f,m=a*f+b*d-h*c,c=-b*c-h*d-g*f;e[0]=j*a+c*-b+l*-g-m*-h;e[1]=l*a+c*-h+m*-b-j*-g;e[2]=m*a+c*-g+j*-h-l*-b; -return e};s.scale=function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a[3]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;e[3]=a[3]*b;return e};s.toMat3=function(a,b){b||(b=F.create());var e=a[0],c=a[1],d=a[2],f=a[3],h=e+e,g=c+c,j=d+d,l=e*h,m=e*g,e=e*j,n=c*g,c=c*j,d=d*j,h=f*h,g=f*g,f=f*j;b[0]=1-(n+d);b[1]=m+f;b[2]=e-g;b[3]=m-f;b[4]=1-(l+d);b[5]=c+h;b[6]=e+g;b[7]=c-h;b[8]=1-(l+n);return b};s.toMat4=function(a,b){b||(b=y.create());var e=a[0],c=a[1],d=a[2],f=a[3],g=e+e,j=c+c,l=d+d,m=e*g,n=e*j,e=e* -l,p=c*j,c=c*l,d=d*l,g=f*g,j=f*j,f=f*l;b[0]=1-(p+d);b[1]=n+f;b[2]=e-j;b[3]=0;b[4]=n-f;b[5]=1-(m+d);b[6]=c+g;b[7]=0;b[8]=e+j;b[9]=c-g;b[10]=1-(m+p);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};s.slerp=function(a,b,c,d){d||(d=a);var f=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],g,h;if(1<=Math.abs(f))return d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d;g=Math.acos(f);h=Math.sqrt(1-f*f);if(0.001>Math.abs(h))return d[0]=0.5*a[0]+0.5*b[0],d[1]=0.5*a[1]+0.5*b[1],d[2]=0.5*a[2]+0.5*b[2],d[3]=0.5*a[3]+ -0.5*b[3],d;f=Math.sin((1-c)*g)/h;c=Math.sin(c*g)/h;d[0]=a[0]*f+b[0]*c;d[1]=a[1]*f+b[1]*c;d[2]=a[2]*f+b[2]*c;d[3]=a[3]*f+b[3]*c;return d};s.fromRotationMatrix=function(a,b){b||(b=s.create());var c=a[0]+a[4]+a[8],d;if(0a[0]&&(c=1);a[8]>a[3*c+c]&&(c=2);var f=d[c],g=d[f];d=Math.sqrt(a[3*c+c]-a[3*f+f]-a[3*g+g]+1);b[c]=0.5*d;d= -0.5/d;b[3]=(a[3*g+f]-a[3*f+g])*d;b[f]=(a[3*f+c]+a[3*c+f])*d;b[g]=(a[3*g+c]+a[3*c+g])*d}return b};F.toQuat4=s.fromRotationMatrix;var D=F.create();s.fromAxes=function(a,b,c,d){D[0]=b[0];D[3]=b[1];D[6]=b[2];D[1]=c[0];D[4]=c[1];D[7]=c[2];D[2]=a[0];D[5]=a[1];D[8]=a[2];return s.fromRotationMatrix(D,d)};s.identity=function(a){a||(a=s.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};s.fromAngleAxis=function(a,b,c){c||(c=s.create());a*=0.5;var d=Math.sin(a);c[3]=Math.cos(a);c[0]=d*b[0];c[1]=d*b[1];c[2]=d*b[2]; -return c};s.toAngleAxis=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); -b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 -Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],f=a[2],g=a[3],h=c*g-f*d;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-d*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, -b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];c[0]=d*b[0]+f*b[2];c[1]=d*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=d*b+f*h;c[1]=d*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var d=b[0];b=b[1];c[0]=d*a[0]+b*a[1];c[1]=d*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var d=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=d*b;c[2]=f*h;c[3]= -g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,d){var f=new l(4);f[0]=a;f[1]=b;f[2]=c;f[3]=d;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, -b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| -(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)},squaredLength:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};c&&(c.glMatrixArrayType=l,c.MatrixArray=l,c.setMatrixArrayType=d,c.determineMatrixArrayType= -f,c.glMath=g,c.vec2=M,c.vec3=j,c.vec4=N,c.mat2=L,c.mat3=F,c.mat4=y,c.quat4=s);return{glMatrixArrayType:l,MatrixArray:l,setMatrixArrayType:d,determineMatrixArrayType:f,glMath:g,vec2:M,vec3:j,vec4:N,mat2:L,mat3:F,mat4:y,quat4:s}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * vColor;","}"]; -PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"]; -PIXI.CompileVertexShader=function(c,d){for(var f="",g=0;g 0) { - this.checkVisibility(child); + this.checkVisibility(child, actualVisibility); } + + }; } -/** - * @private - */ -PIXI.WebGLRenderer.prototype.setGLVisible = function(displayObject, visibility) -{ - var children = displayObject.children; - - for (var i=0; i < children.length; i++) - { - var child = children[i]; - - if(visibility) - { - this.addDisplayObject(child); - } - else - { - this.removeDisplayObject(child); - } - - if(child.children.length > 0) - { - this.setGLVisible(child, visibility); - } - } - -} - /** * Renders the stage to its webGL view - * @param the PIXI.Stage element to be rendered + * @method render + * @param stage {Stage} the PIXI.Stage element to be rendered */ PIXI.WebGLRenderer.prototype.render = function(stage) { @@ -185,9 +164,18 @@ // update children if need be // best to remove first! - for (var i=0; i < stage.__childrenRemoved.length; i++) this.removeDisplayObject(stage.__childrenRemoved[i]); + for (var i=0; i < stage.__childrenRemoved.length; i++) + { + this.removeDisplayObject(stage.__childrenRemoved[i]); + // stage.__childrenRemoved[i].cacheVisible = false; + } + /* // no add all new sprites - for (var i=0; i < stage.__childrenAdded.length; i++) this.addDisplayObject(stage.__childrenAdded[i]); + for (var i=0; i < stage.__childrenAdded.length; i++) + { + stage.__childrenAdded[i].cacheVisible = false; +// this.addDisplayObject(stage.__childrenAdded[i]); + }*/ // update any textures for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]); @@ -197,7 +185,7 @@ PIXI.texturesToUpdate = []; // recursivly loop through all items! - this.checkVisibility(stage); + this.checkVisibility(stage, true); // update the scen graph stage.updateTransform(); @@ -206,7 +194,7 @@ gl.clear(gl.COLOR_BUFFER_BIT) - gl.clearColor(1, 1, 1, 1.0); + gl.clearColor(0, 0, 0, 1.0); // set the correct blend mode! gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); @@ -265,12 +253,16 @@ */ PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject) { - if(!displayObject.stage)return; - displayObject.cacheVisible = displayObject.visible; + if(!displayObject.stage)return; // means it was removed + if(displayObject.__inWebGL)return; //means it is already in webgL - if(!displayObject.visible)return; + //displayObject.cacheVisible = displayObject.visible; + + // TODO if objects parent is not visible then dont add to stage!!!! + //if(!displayObject.visible)return; + displayObject.batch = null; //displayObject.cacheVisible = true; @@ -458,10 +450,12 @@ PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject) { //if(displayObject.stage)return; - displayObject.cacheVisible = displayObject.visible; + displayObject.cacheVisible = false;//displayObject.visible; if(!displayObject.renderable)return; + displayObject.__inWebGL = false; + /* * removing is a lot quicker.. * @@ -472,9 +466,11 @@ { // should always have a batch! var batch = displayObject.batch; - if(!batch)return; // thismeans the display list has been altered befre rendering + if(!batch)return; // this means the display list has been altered befre rendering batch.remove(displayObject); + + if(batch.size==0) { batchToRemove = batch @@ -528,8 +524,9 @@ /** * resizes the webGL view to the specified width and height - * @param the new width of the webGL view - * @param the new height of the webGL view + * @method resize + * @param width {Number} the new width of the webGL view + * @param height {Number} the new height of the webGL view */ PIXI.WebGLRenderer.prototype.resize = function(width, height) { diff --git a/src/pixi/renderers/WebGLShaders.js b/src/pixi/renderers/WebGLShaders.js index 8a109dc..b717256 100644 --- a/src/pixi/renderers/WebGLShaders.js +++ b/src/pixi/renderers/WebGLShaders.js @@ -2,7 +2,6 @@ /** * @author Mat Groves http://matgroves.com/ */ -var PIXI = PIXI || {}; PIXI.shaderFragmentSrc = [ "precision mediump float;", "varying vec2 vTextureCoord;", diff --git a/src/pixi/textures/BaseTexture.js b/src/pixi/textures/BaseTexture.js index 0d2221d..a3fdce7 100644 --- a/src/pixi/textures/BaseTexture.js +++ b/src/pixi/textures/BaseTexture.js @@ -1,17 +1,16 @@ /** * @author Mat Groves http://matgroves.com/ */ -var PIXI = PIXI || {}; PIXI.BaseTextureCache = {}; PIXI.texturesToUpdate = []; /** - * @class A texture stores the information that represents an image. All textures have a base texture - * @augments PIXI.EventTarget + * A texture stores the information that represents an image. All textures have a base texture + * @class BaseTexture + * @extends EventTarget * @constructor - * @param image url - * @return A new BaseTexture + * @param imageUrl {String} image url */ PIXI.BaseTexture = function(imageUrl) { @@ -19,13 +18,15 @@ /** * The url of the texture - * @type #BaseTexture + * @property imageUrl + * @type String */ this.imageUrl = imageUrl; /** * The html image that is loaded to create the texture - * @type #BaseTexture + * @property image + * @type Image */ this.image = new Image(); @@ -41,17 +42,19 @@ scope.dispatchEvent( { type: 'loaded', content: scope } ); } - $.proxy(this.onImageLoaded, this); + $.proxy(this.onImageLoaded, this); this.image.src = imageUrl; /** * [read only] The width of the base texture set when the image has loaded - * @type #BaseTexture + * @property width + * @type Number */ this.width = 100; /** * [read only] The height of the base texture set when the image has loaded - * @type #BaseTexture + * @property height + * @type Number */ this.height = 100; diff --git a/src/pixi/textures/Texture.js b/src/pixi/textures/Texture.js index e46fd9f..3f6457a 100644 --- a/src/pixi/textures/Texture.js +++ b/src/pixi/textures/Texture.js @@ -1,18 +1,17 @@ /** * @author Mat Groves http://matgroves.com/ */ -var PIXI = PIXI || {}; PIXI.TextureCache = {}; PIXI.FrameCache = {}; /** - * @class A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used - * @augments PIXI.EventTarget + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used + * @class Texture + * @extends EventTarget * @constructor - * @param {PIXI.textures.BaseTexture} base texture {@link PIXI.textures.BaseTexture} - * @param {PIXI.Rectangle} frame {@link PIXI.Rectangle} - * @return A new Texture. + * @param baseTexture {BaseTexture} + * @param frmae {Rectangle} */ PIXI.Texture = function(baseTexture, frame) { @@ -24,9 +23,12 @@ frame = new PIXI.Rectangle(0,0,1,1); } + this.trim = new PIXI.Point(); + /** * The base texture of this texture - * @type #BaseTexture + * @property baseTexture + * @type BaseTexture */ this.baseTexture = baseTexture; @@ -34,6 +36,7 @@ /** * The frame specifies the region of the base texture that this texture uses + * @property frame * @type #Rectangle */ this.frame = frame; @@ -71,8 +74,8 @@ /** * Specifies the rectangle region of the baseTexture - * @param {PIXI.Rectangle} frame {@link PIXI.Rectangle} - * @return A new Texture. + * @method setFrame + * @param frame {Rectangle} */ PIXI.Texture.prototype.setFrame = function(frame) { @@ -86,8 +89,10 @@ * * Helper function that returns a texture based on an image url * If the image is not in the texture cache it will be created and loaded - * @param The image url of the texture - * @return {PIXI.textures.Texture} texture {@link PIXI.textures.Texture} + * @static + * @method fromImage + * @param imageUrl {String} The image url of the texture + * @return Texture */ PIXI.Texture.fromImage = function(imageUrl) { @@ -108,21 +113,23 @@ * * Helper function that returns a texture based on a frame id * If the frame id is not in the texture cache an error will be thrown - * @param The frame id of the texture - * @return {PIXI.textures.Texture} texture {@link PIXI.textures.Texture} + * @method fromFrameId + * @param frameId {String} The frame id of the texture + * @return Texture */ PIXI.Texture.fromFrameId = function(frameId) { var texture = PIXI.TextureCache[frameId]; - if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this); + if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this); return texture; } /** * * Adds a texture to the textureCache. - * @param {PIXI.textures.Texture} texture {@link PIXI.textures.Texture} - * @param the id that the texture will be stored against. + * @method addTextureToCache + * @param texture {Texture} + * @param id {String} the id that the texture will be stored against. */ PIXI.Texture.addTextureToCache = function(texture, id) { @@ -132,9 +139,10 @@ /** * * Remove a texture from the textureCache. - * @param the id of the texture to be removed + * @method removeTextureFromCache + * @param id {String} the id of the texture to be removed */ -PIXI.Texture.addTextureToCache = function(id) +PIXI.Texture.removeTextureFromCache = function(id) { PIXI.TextureCache[id] = texture; } diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/examples/bunny benchmark/index.html b/examples/bunny benchmark/index.html index 7c5521b..95972c4 100644 --- a/examples/bunny benchmark/index.html +++ b/examples/bunny benchmark/index.html @@ -9,9 +9,10 @@ +
    Click to add more bunnys! Let me know how many you get on screen here @doormat23
    - + diff --git a/examples/bunny benchmark/js/bunnyBenchMark.js b/examples/bunny benchmark/js/bunnyBenchMark.js index a3154eb..c3c8ec5 100644 --- a/examples/bunny benchmark/js/bunnyBenchMark.js +++ b/examples/bunny benchmark/js/bunnyBenchMark.js @@ -22,18 +22,13 @@ var count = 0; var container; +var detail; + function onReady() { - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() + detail = document.getElementById("pixi"); - if(webgl) - { - renderer = new PIXI.WebGLRenderer(); - } - else - { - renderer = new PIXI.CanvasRenderer(480, 320); - } + renderer = PIXI.autoDetectRenderer(); stage = new PIXI.Stage; @@ -46,7 +41,7 @@ stats.domElement.style.top = "0px"; requestAnimFrame(update); - wabbitTexture = new PIXI.Texture("wabbit.png") + wabbitTexture = new PIXI.Texture.fromImage("wabbit.png") counter = document.createElement("div"); counter.className = "counter"; @@ -55,7 +50,6 @@ count = startBunnyCount; counter.innerHTML = count + " BUNNIES"; - container = new PIXI.DisplayObjectContainer(); stage.addChild(container); @@ -114,7 +108,9 @@ minX = 0; maxY = height; minY = 0; - + + detail.style.left = width - 204 + "px"; + detail.style.top = height - 100 + "px"; renderer.resize(width, height); } @@ -126,17 +122,17 @@ { // add 10 at a time :) - for (var i = 0; i < 2; i++) + for (var i = 0; i < 10; i++) { - var bunny = new PIXI.Sprite(wabbitTexture, {x:0, y:0, width:26, height:37}); + var bunny = new PIXI.Sprite(wabbitTexture); bunny.speedX = Math.random() * 10; bunny.speedY = (Math.random() * 10) - 5; bunny.anchor.x = 0.5; bunny.anchor.y = 1; - bunny.alpha = 0.3 + Math.random() * 0.7; + //bunny.alpha = 0.3 + Math.random() * 0.7; bunnys.push(bunny); - bunny.rotation = Math.random() - 0.5; + //bunny.rotation = Math.random() - 0.5; container.addChild(bunny); count++; diff --git a/examples/bunny benchmark/js/pixi.js b/examples/bunny benchmark/js/pixi.js new file mode 100644 index 0000000..65add09 --- /dev/null +++ b/examples/bunny benchmark/js/pixi.js @@ -0,0 +1,110 @@ +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, +d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* +j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= +a[0]-d[0],c=a[1]-d[1];a=a[2]-d[2];d=Math.sqrt(b*b+c*c+a*a);if(!d)return j[0]=0,j[1]=0,j[2]=0,j;d=1/d;j[0]=b*d;j[1]=c*d;j[2]=a*d;return j},lerp:function(a,d,j,b){b||(b=a);b[0]=a[0]+j*(d[0]-a[0]);b[1]=a[1]+j*(d[1]-a[1]);b[2]=a[2]+j*(d[2]-a[2]);return b},dist:function(a,d){var j=d[0]-a[0],b=d[1]-a[1],c=d[2]-a[2];return Math.sqrt(j*j+b*b+c*c)}},p=null,q=new k(4);l.unproject=function(a,d,j,b,c){c||(c=a);p||(p=t.create());var e=p;q[0]=2*(a[0]-b[0])/b[2]-1;q[1]=2*(a[1]-b[1])/b[3]-1;q[2]=2*a[2]-1;q[3]=1; +t.multiply(j,d,e);if(!t.inverse(e))return null;t.multiplyVec4(e,q);if(0===q[3])return null;c[0]=q[0]/q[3];c[1]=q[1]/q[3];c[2]=q[2]/q[3];return c};var C=l.createFrom(1,0,0),F=l.createFrom(0,1,0),u=l.createFrom(0,0,1),w=l.create();l.rotationTo=function(a,d,j){j||(j=m.create());var b=l.dot(a,d);if(1<=b)m.set(H,j);else if(-0.999999>b)l.cross(C,a,w),1E-6>l.length(w)&&l.cross(F,a,w),1E-6>l.length(w)&&l.cross(u,a,w),l.normalize(w),m.fromAngleAxis(Math.PI,w,j);else{var b=Math.sqrt(2*(1+b)),c=1/b;l.cross(a, +d,w);j[0]=w[0]*c;j[1]=w[1]*c;j[2]=w[2]*c;j[3]=0.5*b;m.normalize(j)}1j[3]&&(j[3]=-1);return j};l.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var x={create:function(a){var d=new k(9);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8]):d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=0;return d},createFrom:function(a,d,j,b,c,e,n,f,E){var s=new k(9);s[0]=a;s[1]=d;s[2]=j;s[3]=b;s[4]=c;s[5]=e;s[6]=n;s[7]=f;s[8]=E;return s},determinant:function(a){var d= +a[3],j=a[4],b=a[5],c=a[6],e=a[7],n=a[8];return a[0]*(n*j-b*e)+a[1]*(-n*d+b*c)+a[2]*(e*d-j*c)},inverse:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[3],n=a[4],f=a[5],E=a[6],s=a[7],I=a[8],g=I*n-f*s,h=-I*e+f*E,k=s*e-n*E,r=j*g+b*h+c*k;if(!r)return null;r=1/r;d||(d=x.create());d[0]=g*r;d[1]=(-I*b+c*s)*r;d[2]=(f*b-c*n)*r;d[3]=h*r;d[4]=(I*j-c*E)*r;d[5]=(-f*j+c*e)*r;d[6]=k*r;d[7]=(-s*j+b*E)*r;d[8]=(n*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],D=a[4],E=a[5],s=a[6],I= +a[7];a=a[8];var g=d[0],h=d[1],k=d[2],r=d[3],m=d[4],l=d[5],q=d[6],v=d[7];d=d[8];j[0]=g*b+h*f+k*s;j[1]=g*c+h*D+k*I;j[2]=g*e+h*E+k*a;j[3]=r*b+m*f+l*s;j[4]=r*c+m*D+l*I;j[5]=r*e+m*E+l*a;j[6]=q*b+v*f+d*s;j[7]=q*c+v*D+d*I;j[8]=q*e+v*E+d*a;return j},multiplyVec2:function(a,d,j){j||(j=d);var b=d[0];d=d[1];j[0]=b*a[0]+d*a[3]+a[6];j[1]=b*a[1]+d*a[4]+a[7];return j},multiplyVec3:function(a,d,j){j||(j=d);var b=d[0],c=d[1];d=d[2];j[0]=b*a[0]+c*a[3]+d*a[6];j[1]=b*a[1]+c*a[4]+d*a[7];j[2]=b*a[2]+c*a[5]+d*a[8];return j}, +set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])},identity:function(a){a||(a=x.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, +d){if(!d||a===d){var j=a[1],b=a[2],c=a[5];a[1]=a[3];a[2]=a[6];a[3]=j;a[5]=a[7];a[6]=b;a[7]=c;return a}d[0]=a[0];d[1]=a[3];d[2]=a[6];d[3]=a[1];d[4]=a[4];d[5]=a[7];d[6]=a[2];d[7]=a[5];d[8]=a[8];return d},toMat4:function(a,d){d||(d=t.create());d[15]=1;d[14]=0;d[13]=0;d[12]=0;d[11]=0;d[10]=a[8];d[9]=a[7];d[8]=a[6];d[7]=0;d[6]=a[5];d[5]=a[4];d[4]=a[3];d[3]=0;d[2]=a[2];d[1]=a[1];d[0]=a[0];return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ +a[8]+"]"}},t={create:function(a){var d=new k(16);a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8],d[9]=a[9],d[10]=a[10],d[11]=a[11],d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d},createFrom:function(a,d,j,b,c,e,f,D,E,s,g,h,m,l,r,q){var A=new k(16);A[0]=a;A[1]=d;A[2]=j;A[3]=b;A[4]=c;A[5]=e;A[6]=f;A[7]=D;A[8]=E;A[9]=s;A[10]=g;A[11]=h;A[12]=m;A[13]=l;A[14]=r;A[15]=q;return A},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4]; +d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=a[12];d[13]=a[13];d[14]=a[14];d[15]=a[15];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])&&1E-6>Math.abs(a[9]-d[9])&&1E-6>Math.abs(a[10]-d[10])&&1E-6>Math.abs(a[11]-d[11])&&1E-6>Math.abs(a[12]- +d[12])&&1E-6>Math.abs(a[13]-d[13])&&1E-6>Math.abs(a[14]-d[14])&&1E-6>Math.abs(a[15]-d[15])},identity:function(a){a||(a=t.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,d){if(!d||a===d){var j=a[1],b=a[2],c=a[3],e=a[6],f=a[7],D=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=j;a[6]=a[9];a[7]=a[13];a[8]=b;a[9]=e;a[11]=a[14];a[12]=c;a[13]=f;a[14]=D;return a}d[0]=a[0];d[1]=a[4];d[2]=a[8];d[3]=a[12]; +d[4]=a[1];d[5]=a[5];d[6]=a[9];d[7]=a[13];d[8]=a[2];d[9]=a[6];d[10]=a[10];d[11]=a[14];d[12]=a[3];d[13]=a[7];d[14]=a[11];d[15]=a[15];return d},determinant:function(a){var d=a[0],j=a[1],b=a[2],c=a[3],e=a[4],f=a[5],D=a[6],E=a[7],s=a[8],g=a[9],h=a[10],k=a[11],m=a[12],r=a[13],l=a[14];a=a[15];return m*g*D*c-s*r*D*c-m*f*h*c+e*r*h*c+s*f*l*c-e*g*l*c-m*g*b*E+s*r*b*E+m*j*h*E-d*r*h*E-s*j*l*E+d*g*l*E+m*f*b*k-e*r*b*k-m*j*D*k+d*r*D*k+e*j*l*k-d*f*l*k-s*f*b*a+e*g*b*a+s*j*D*a-d*g*D*a-e*j*h*a+d*f*h*a},inverse:function(a, +d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=a[3],f=a[4],D=a[5],E=a[6],s=a[7],g=a[8],h=a[9],k=a[10],m=a[11],r=a[12],l=a[13],A=a[14],q=a[15],v=j*D-b*f,J=j*E-c*f,y=j*s-e*f,z=b*E-c*D,t=b*s-e*D,u=c*s-e*E,p=g*l-h*r,w=g*A-k*r,x=g*q-m*r,B=h*A-k*l,C=h*q-m*l,F=k*q-m*A,G=v*F-J*C+y*B+z*x-t*w+u*p;if(!G)return null;G=1/G;d[0]=(D*F-E*C+s*B)*G;d[1]=(-b*F+c*C-e*B)*G;d[2]=(l*u-A*t+q*z)*G;d[3]=(-h*u+k*t-m*z)*G;d[4]=(-f*F+E*x-s*w)*G;d[5]=(j*F-c*x+e*w)*G;d[6]=(-r*u+A*y-q*J)*G;d[7]=(g*u-k*y+m*J)*G;d[8]=(f*C-D*x+s*p)*G;d[9]= +(-j*C+b*x-e*p)*G;d[10]=(r*t-l*y+q*v)*G;d[11]=(-g*t+h*y-m*v)*G;d[12]=(-f*B+D*w-E*p)*G;d[13]=(j*B-b*w+c*p)*G;d[14]=(-r*z+l*J-A*v)*G;d[15]=(g*z-h*J+k*v)*G;return d},toRotationMat:function(a,d){d||(d=t.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d},toMat3:function(a,d){d||(d=x.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[4];d[4]=a[5];d[5]=a[6];d[6]=a[8];d[7]=a[9];d[8]=a[10]; +return d},toInverseMat3:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[4],f=a[5],D=a[6],g=a[8],s=a[9],h=a[10],k=h*f-D*s,m=-h*e+D*g,l=s*e-f*g,r=j*k+b*m+c*l;if(!r)return null;r=1/r;d||(d=x.create());d[0]=k*r;d[1]=(-h*b+c*s)*r;d[2]=(D*b-c*f)*r;d[3]=m*r;d[4]=(h*j-c*g)*r;d[5]=(-D*j+c*e)*r;d[6]=l*r;d[7]=(-s*j+b*g)*r;d[8]=(f*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],s=a[6],k=a[7],m=a[8],l=a[9],q=a[10],r=a[11],t=a[12],A=a[13],u=a[14];a=a[15];var v=d[0], +p=d[1],y=d[2],z=d[3];j[0]=v*b+p*g+y*m+z*t;j[1]=v*c+p*h+y*l+z*A;j[2]=v*e+p*s+y*q+z*u;j[3]=v*f+p*k+y*r+z*a;v=d[4];p=d[5];y=d[6];z=d[7];j[4]=v*b+p*g+y*m+z*t;j[5]=v*c+p*h+y*l+z*A;j[6]=v*e+p*s+y*q+z*u;j[7]=v*f+p*k+y*r+z*a;v=d[8];p=d[9];y=d[10];z=d[11];j[8]=v*b+p*g+y*m+z*t;j[9]=v*c+p*h+y*l+z*A;j[10]=v*e+p*s+y*q+z*u;j[11]=v*f+p*k+y*r+z*a;v=d[12];p=d[13];y=d[14];z=d[15];j[12]=v*b+p*g+y*m+z*t;j[13]=v*c+p*h+y*l+z*A;j[14]=v*e+p*s+y*q+z*u;j[15]=v*f+p*k+y*r+z*a;return j},multiplyVec3:function(a,d,b){b||(b=d); +var c=d[0],e=d[1];d=d[2];b[0]=a[0]*c+a[4]*e+a[8]*d+a[12];b[1]=a[1]*c+a[5]*e+a[9]*d+a[13];b[2]=a[2]*c+a[6]*e+a[10]*d+a[14];return b},multiplyVec4:function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=d[3];b[0]=a[0]*c+a[4]*e+a[8]*f+a[12]*d;b[1]=a[1]*c+a[5]*e+a[9]*f+a[13]*d;b[2]=a[2]*c+a[6]*e+a[10]*f+a[14]*d;b[3]=a[3]*c+a[7]*e+a[11]*f+a[15]*d;return b},translate:function(a,d,b){var c=d[0],e=d[1];d=d[2];var f,n,g,h,s,k,m,l,p,r,q,t;if(!b||a===b)return a[12]=a[0]*c+a[4]*e+a[8]*d+a[12],a[13]=a[1]*c+a[5]*e+ +a[9]*d+a[13],a[14]=a[2]*c+a[6]*e+a[10]*d+a[14],a[15]=a[3]*c+a[7]*e+a[11]*d+a[15],a;f=a[0];n=a[1];g=a[2];h=a[3];s=a[4];k=a[5];m=a[6];l=a[7];p=a[8];r=a[9];q=a[10];t=a[11];b[0]=f;b[1]=n;b[2]=g;b[3]=h;b[4]=s;b[5]=k;b[6]=m;b[7]=l;b[8]=p;b[9]=r;b[10]=q;b[11]=t;b[12]=f*c+s*e+p*d+a[12];b[13]=n*c+k*e+r*d+a[13];b[14]=g*c+m*e+q*d+a[14];b[15]=h*c+l*e+t*d+a[15];return b},scale:function(a,d,b){var c=d[0],e=d[1];d=d[2];if(!b||a===b)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=d,a[9]*= +d,a[10]*=d,a[11]*=d,a;b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[7]=a[7]*e;b[8]=a[8]*d;b[9]=a[9]*d;b[10]=a[10]*d;b[11]=a[11]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},rotate:function(a,d,b,c){var e=b[0],f=b[1];b=b[2];var n=Math.sqrt(e*e+f*f+b*b),g,h,k,m,l,p,q,r,t,u,w,v,x,y,z,B,C,F,H,K;if(!n)return null;1!==n&&(n=1/n,e*=n,f*=n,b*=n);g=Math.sin(d);h=Math.cos(d);k=1-h;d=a[0];n=a[1];m=a[2];l=a[3];p=a[4];q=a[5];r=a[6];t=a[7];u=a[8];w=a[9];v= +a[10];x=a[11];y=e*e*k+h;z=f*e*k+b*g;B=b*e*k-f*g;C=e*f*k-b*g;F=f*f*k+h;H=b*f*k+e*g;K=e*b*k+f*g;e=f*b*k-e*g;f=b*b*k+h;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=d*y+p*z+u*B;c[1]=n*y+q*z+w*B;c[2]=m*y+r*z+v*B;c[3]=l*y+t*z+x*B;c[4]=d*C+p*F+u*H;c[5]=n*C+q*F+w*H;c[6]=m*C+r*F+v*H;c[7]=l*C+t*F+x*H;c[8]=d*K+p*e+u*f;c[9]=n*K+q*e+w*f;c[10]=m*K+r*e+v*f;c[11]=l*K+t*e+x*f;return c},rotateX:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[4],f=a[5],n=a[6],g=a[7],h=a[8],k=a[9],m=a[10], +l=a[11];b?a!==b&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[4]=e*d+h*c;b[5]=f*d+k*c;b[6]=n*d+m*c;b[7]=g*d+l*c;b[8]=e*-c+h*d;b[9]=f*-c+k*d;b[10]=n*-c+m*d;b[11]=g*-c+l*d;return b},rotateY:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[8],k=a[9],m=a[10],l=a[11];b?a!==b&&(b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*-c;b[1]=f*d+k*-c;b[2]=n*d+m*-c;b[3]=g* +d+l*-c;b[8]=e*c+h*d;b[9]=f*c+k*d;b[10]=n*c+m*d;b[11]=g*c+l*d;return b},rotateZ:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[4],k=a[5],m=a[6],l=a[7];b?a!==b&&(b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*c;b[1]=f*d+k*c;b[2]=n*d+m*c;b[3]=g*d+l*c;b[4]=e*-c+h*d;b[5]=f*-c+k*d;b[6]=n*-c+m*d;b[7]=g*-c+l*d;return b},frustum:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2*e/g;n[1]=0; +n[2]=0;n[3]=0;n[4]=0;n[5]=2*e/h;n[6]=0;n[7]=0;n[8]=(d+a)/g;n[9]=(c+b)/h;n[10]=-(f+e)/k;n[11]=-1;n[12]=0;n[13]=0;n[14]=-(2*f*e)/k;n[15]=0;return n},perspective:function(a,d,b,c,e){a=b*Math.tan(a*Math.PI/360);d*=a;return t.frustum(-d,d,-a,a,b,c,e)},ortho:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2/g;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=2/h;n[6]=0;n[7]=0;n[8]=0;n[9]=0;n[10]=-2/k;n[11]=0;n[12]=-(a+d)/g;n[13]=-(c+b)/h;n[14]=-(f+e)/k;n[15]=1;return n},lookAt:function(a,d,b,c){c|| +(c=t.create());var e,f,n,g,h,k,m,l,p=a[0],q=a[1];a=a[2];n=b[0];g=b[1];f=b[2];m=d[0];b=d[1];e=d[2];if(p===m&&q===b&&a===e)return t.identity(c);d=p-m;b=q-b;m=a-e;l=1/Math.sqrt(d*d+b*b+m*m);d*=l;b*=l;m*=l;e=g*m-f*b;f=f*d-n*m;n=n*b-g*d;(l=Math.sqrt(e*e+f*f+n*n))?(l=1/l,e*=l,f*=l,n*=l):n=f=e=0;g=b*n-m*f;h=m*e-d*n;k=d*f-b*e;(l=Math.sqrt(g*g+h*h+k*k))?(l=1/l,g*=l,h*=l,k*=l):k=h=g=0;c[0]=e;c[1]=g;c[2]=d;c[3]=0;c[4]=f;c[5]=h;c[6]=b;c[7]=0;c[8]=n;c[9]=k;c[10]=m;c[11]=0;c[12]=-(e*p+f*q+n*a);c[13]=-(g*p+h*q+ +k*a);c[14]=-(d*p+b*q+m*a);c[15]=1;return c},fromRotationTranslation:function(a,d,b){b||(b=t.create());var c=a[0],e=a[1],f=a[2],n=a[3],g=c+c,h=e+e,k=f+f;a=c*g;var l=c*h,c=c*k,m=e*h,e=e*k,f=f*k,g=n*g,h=n*h,n=n*k;b[0]=1-(m+f);b[1]=l+n;b[2]=c-h;b[3]=0;b[4]=l-n;b[5]=1-(a+f);b[6]=e+g;b[7]=0;b[8]=c+h;b[9]=e-g;b[10]=1-(a+m);b[11]=0;b[12]=d[0];b[13]=d[1];b[14]=d[2];b[15]=1;return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ +a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},m={create:function(a){var d=new k(4);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]):d[0]=d[1]=d[2]=d[3]=0;return d},createFrom:function(a,d,b,c){var e=new k(4);e[0]=a;e[1]=d;e[2]=b;e[3]=c;return e},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])},identity:function(a){a||(a=m.create()); +a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},H=m.identity();m.calculateW=function(a,d){var b=a[0],c=a[1],e=a[2];if(!d||a===d)return a[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e)),a;d[0]=b;d[1]=c;d[2]=e;d[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e));return d};m.dot=function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3]};m.inverse=function(a,d){var b=a[0],c=a[1],e=a[2],f=a[3],b=(b=b*b+c*c+e*e+f*f)?1/b:0;if(!d||a===d)return a[0]*=-b,a[1]*=-b,a[2]*=-b,a[3]*=b,a;d[0]=-a[0]*b;d[1]=-a[1]*b;d[2]=-a[2]*b;d[3]=a[3]*b; +return d};m.conjugate=function(a,d){if(!d||a===d)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=a[3];return d};m.length=function(a){var d=a[0],b=a[1],c=a[2];a=a[3];return Math.sqrt(d*d+b*b+c*c+a*a)};m.normalize=function(a,d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=Math.sqrt(b*b+c*c+e*e+f*f);if(0===g)return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d;g=1/g;d[0]=b*g;d[1]=c*g;d[2]=e*g;d[3]=f*g;return d};m.add=function(a,d,b){if(!b||a===b)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a[3]+= +d[3],a;b[0]=a[0]+d[0];b[1]=a[1]+d[1];b[2]=a[2]+d[2];b[3]=a[3]+d[3];return b};m.multiply=function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2];a=a[3];var g=d[0],h=d[1],k=d[2];d=d[3];b[0]=c*d+a*g+e*k-f*h;b[1]=e*d+a*h+f*g-c*k;b[2]=f*d+a*k+c*h-e*g;b[3]=a*d-c*g-e*h-f*k;return b};m.multiplyVec3=function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=a[0];var g=a[1],h=a[2];a=a[3];var k=a*c+g*f-h*e,l=a*e+h*c-d*f,m=a*f+d*e-g*c,c=-d*c-g*e-h*f;b[0]=k*a+c*-d+l*-h-m*-g;b[1]=l*a+c*-g+m*-d-k*-h;b[2]=m*a+c*-h+k*-g-l*-d; +return b};m.scale=function(a,d,b){if(!b||a===b)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a;b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[3]=a[3]*d;return b};m.toMat3=function(a,d){d||(d=x.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b*k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=m-f;d[4]=1-(l+e);d[5]=c+g;d[6]=b+h;d[7]=c-g;d[8]=1-(l+p);return d};m.toMat4=function(a,d){d||(d=t.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b* +k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=0;d[4]=m-f;d[5]=1-(l+e);d[6]=c+g;d[7]=0;d[8]=b+h;d[9]=c-g;d[10]=1-(l+p);d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d};m.slerp=function(a,d,b,c){c||(c=a);var e=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3],f,g;if(1<=Math.abs(e))return c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]),c;f=Math.acos(e);g=Math.sqrt(1-e*e);if(0.0010>Math.abs(g))return c[0]=0.5*a[0]+0.5*d[0],c[1]=0.5*a[1]+0.5*d[1],c[2]=0.5*a[2]+0.5*d[2],c[3]=0.5*a[3]+ +0.5*d[3],c;e=Math.sin((1-b)*f)/g;b=Math.sin(b*f)/g;c[0]=a[0]*e+d[0]*b;c[1]=a[1]*e+d[1]*b;c[2]=a[2]*e+d[2]*b;c[3]=a[3]*e+d[3]*b;return c};m.fromRotationMatrix=function(a,d){d||(d=m.create());var b=a[0]+a[4]+a[8],c;if(0a[0]&&(b=1);a[8]>a[3*b+b]&&(b=2);var e=c[b],f=c[e];c=Math.sqrt(a[3*b+b]-a[3*e+e]-a[3*f+f]+1);d[b]=0.5*c;c= +0.5/c;d[3]=(a[3*f+e]-a[3*e+f])*c;d[e]=(a[3*e+b]+a[3*b+e])*c;d[f]=(a[3*f+b]+a[3*b+f])*c}return d};x.toQuat4=m.fromRotationMatrix;var B=x.create();m.fromAxes=function(a,d,b,c){B[0]=d[0];B[3]=d[1];B[6]=d[2];B[1]=b[0];B[4]=b[1];B[7]=b[2];B[2]=a[0];B[5]=a[1];B[8]=a[2];return m.fromRotationMatrix(B,c)};m.identity=function(a){a||(a=m.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};m.fromAngleAxis=function(a,d,b){b||(b=m.create());a*=0.5;var c=Math.sin(a);b[3]=Math.cos(a);b[0]=c*d[0];b[1]=c*d[1];b[2]=c*d[2]; +return b};m.toAngleAxis=function(a,d){d||(d=a);var b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); +b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 +Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],e=a[1],f=a[2],g=a[3],h=c*g-f*e;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-e*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, +b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];c[0]=e*b[0]+f*b[2];c[1]=e*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=e*b+f*h;c[1]=e*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var e=b[0];b=b[1];c[0]=e*a[0]+b*a[1];c[1]=e*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var e=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=e*b;c[2]=f*h;c[3]= +g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, +b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| +(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= +f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; +PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; +PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l>1);var b=m[0];return b*(1.5-0.5*a*b*b)}}else g.invsqrt=function(a){return 1/Math.sqrt(a)}; -var l=null;f();var j={create:function(a){var b=new l(3);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0;return b},createFrom:function(a,b,e){var c=new l(3);c[0]=a;c[1]=b;c[2]=e;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])},add:function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];return e},subtract:function(a, -b,e){if(!e||a===e)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];return e},multiply:function(a,b,e){if(!e||a===e)return a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a;e[0]=a[0]*b[0];e[1]=a[1]*b[1];e[2]=a[2]*b[2];return e},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;return e},normalize:function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=Math.sqrt(e* -e+c*c+d*d);if(!k)return b[0]=0,b[1]=0,b[2]=0,b;if(1===k)return b[0]=e,b[1]=c,b[2]=d,b;k=1/k;b[0]=e*k;b[1]=c*k;b[2]=d*k;return b},cross:function(a,b,e){e||(e=a);var c=a[0],d=a[1];a=a[2];var k=b[0],h=b[1];b=b[2];e[0]=d*b-a*h;e[1]=a*k-c*b;e[2]=c*h-d*k;return e},length:function(a){var b=a[0],e=a[1];a=a[2];return Math.sqrt(b*b+e*e+a*a)},squaredLength:function(a){var b=a[0],e=a[1];a=a[2];return b*b+e*e+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,b,e){e||(e=a);var c= -a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];b=Math.sqrt(c*c+d*d+a*a);if(!b)return e[0]=0,e[1]=0,e[2]=0,e;b=1/b;e[0]=c*b;e[1]=d*b;e[2]=a*b;return e},lerp:function(a,b,e,c){c||(c=a);c[0]=a[0]+e*(b[0]-a[0]);c[1]=a[1]+e*(b[1]-a[1]);c[2]=a[2]+e*(b[2]-a[2]);return c},dist:function(a,b){var e=b[0]-a[0],c=b[1]-a[1],d=b[2]-a[2];return Math.sqrt(e*e+c*c+d*d)}},x=null,n=new l(4);j.unproject=function(a,b,e,c,d){d||(d=a);x||(x=y.create());var k=x;n[0]=2*(a[0]-c[0])/c[2]-1;n[1]=2*(a[1]-c[1])/c[3]-1;n[2]=2*a[2]-1;n[3]=1; -y.multiply(e,b,k);if(!y.inverse(k))return null;y.multiplyVec4(k,n);if(0===n[3])return null;d[0]=n[0]/n[3];d[1]=n[1]/n[3];d[2]=n[2]/n[3];return d};var z=j.createFrom(1,0,0),A=j.createFrom(0,1,0),H=j.createFrom(0,0,1),C=j.create();j.rotationTo=function(a,b,e){e||(e=s.create());var c=j.dot(a,b);if(1<=c)s.set(O,e);else if(-0.999999>c)j.cross(z,a,C),1E-6>j.length(C)&&j.cross(A,a,C),1E-6>j.length(C)&&j.cross(H,a,C),j.normalize(C),s.fromAngleAxis(Math.PI,C,e);else{var c=Math.sqrt(2*(1+c)),d=1/c;j.cross(a, -b,C);e[0]=C[0]*d;e[1]=C[1]*d;e[2]=C[2]*d;e[3]=0.5*c;s.normalize(e)}1e[3]&&(e[3]=-1);return e};j.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var F={create:function(a){var b=new l(9);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0;return b},createFrom:function(a,b,e,c,d,k,h,E,K){var q=new l(9);q[0]=a;q[1]=b;q[2]=e;q[3]=c;q[4]=d;q[5]=k;q[6]=h;q[7]=E;q[8]=K;return q},determinant:function(a){var b= -a[3],e=a[4],c=a[5],d=a[6],k=a[7],h=a[8];return a[0]*(h*e-c*k)+a[1]*(-h*b+c*d)+a[2]*(k*b-e*d)},inverse:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],E=a[5],K=a[6],q=a[7],f=a[8],g=f*h-E*q,j=-f*k+E*K,J=q*k-h*K,r=e*g+c*j+d*J;if(!r)return null;r=1/r;b||(b=F.create());b[0]=g*r;b[1]=(-f*c+d*q)*r;b[2]=(E*c-d*h)*r;b[3]=j*r;b[4]=(f*e-d*K)*r;b[5]=(-E*e+d*k)*r;b[6]=J*r;b[7]=(-q*e+c*K)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],E=a[4],f=a[5],q=a[6],g= -a[7];a=a[8];var u=b[0],j=b[1],J=b[2],r=b[3],l=b[4],t=b[5],m=b[6],p=b[7];b=b[8];e[0]=u*c+j*h+J*q;e[1]=u*d+j*E+J*g;e[2]=u*k+j*f+J*a;e[3]=r*c+l*h+t*q;e[4]=r*d+l*E+t*g;e[5]=r*k+l*f+t*a;e[6]=m*c+p*h+b*q;e[7]=m*d+p*E+b*g;e[8]=m*k+p*f+b*a;return e},multiplyVec2:function(a,b,e){e||(e=b);var c=b[0];b=b[1];e[0]=c*a[0]+b*a[3]+a[6];e[1]=c*a[1]+b*a[4]+a[7];return e},multiplyVec3:function(a,b,e){e||(e=b);var c=b[0],d=b[1];b=b[2];e[0]=c*a[0]+d*a[3]+b*a[6];e[1]=c*a[1]+d*a[4]+b*a[7];e[2]=c*a[2]+d*a[5]+b*a[8];return e}, -set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])},identity:function(a){a||(a=F.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, -b){if(!b||a===b){var e=a[1],c=a[2],d=a[5];a[1]=a[3];a[2]=a[6];a[3]=e;a[5]=a[7];a[6]=c;a[7]=d;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]=a[8];return b},toMat4:function(a,b){b||(b=y.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ -a[8]+"]"}},y={create:function(a){var b=new l(16);a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]);return b},createFrom:function(a,b,e,c,d,k,h,E,f,q,g,u,j,J,r,m){var t=new l(16);t[0]=a;t[1]=b;t[2]=e;t[3]=c;t[4]=d;t[5]=k;t[6]=h;t[7]=E;t[8]=f;t[9]=q;t[10]=g;t[11]=u;t[12]=j;t[13]=J;t[14]=r;t[15]=m;return t},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4]; -b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])&&1E-6>Math.abs(a[9]-b[9])&&1E-6>Math.abs(a[10]-b[10])&&1E-6>Math.abs(a[11]-b[11])&&1E-6>Math.abs(a[12]- -b[12])&&1E-6>Math.abs(a[13]-b[13])&&1E-6>Math.abs(a[14]-b[14])&&1E-6>Math.abs(a[15]-b[15])},identity:function(a){a||(a=y.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){var e=a[1],c=a[2],d=a[3],k=a[6],h=a[7],E=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=e;a[6]=a[9];a[7]=a[13];a[8]=c;a[9]=k;a[11]=a[14];a[12]=d;a[13]=h;a[14]=E;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12]; -b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b=a[0],e=a[1],c=a[2],d=a[3],k=a[4],h=a[5],E=a[6],f=a[7],g=a[8],I=a[9],u=a[10],j=a[11],l=a[12],r=a[13],m=a[14];a=a[15];return l*I*E*d-g*r*E*d-l*h*u*d+k*r*u*d+g*h*m*d-k*I*m*d-l*I*c*f+g*r*c*f+l*e*u*f-b*r*u*f-g*e*m*f+b*I*m*f+l*h*c*j-k*r*c*j-l*e*E*j+b*r*E*j+k*e*m*j-b*h*m*j-g*h*c*a+k*I*c*a+g*e*E*a-b*I*E*a-k*e*u*a+b*h*u*a},inverse:function(a, -b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],f=a[5],g=a[6],q=a[7],I=a[8],u=a[9],j=a[10],l=a[11],r=a[12],m=a[13],t=a[14],p=a[15],s=e*f-c*h,n=e*g-d*h,v=e*q-k*h,w=c*g-d*f,x=c*q-k*f,y=d*q-k*g,z=I*m-u*r,A=I*t-j*r,C=I*p-l*r,D=u*t-j*m,F=u*p-l*m,H=j*p-l*t,G=s*H-n*F+v*D+w*C-x*A+y*z;if(!G)return null;G=1/G;b[0]=(f*H-g*F+q*D)*G;b[1]=(-c*H+d*F-k*D)*G;b[2]=(m*y-t*x+p*w)*G;b[3]=(-u*y+j*x-l*w)*G;b[4]=(-h*H+g*C-q*A)*G;b[5]=(e*H-d*C+k*A)*G;b[6]=(-r*y+t*v-p*n)*G;b[7]=(I*y-j*v+l*n)*G;b[8]=(h*F-f*C+q*z)*G;b[9]= -(-e*F+c*C-k*z)*G;b[10]=(r*x-m*v+p*s)*G;b[11]=(-I*x+u*v-l*s)*G;b[12]=(-h*D+f*A-g*z)*G;b[13]=(e*D-c*A+d*z)*G;b[14]=(-r*w+m*n-t*s)*G;b[15]=(I*w-u*n+j*s)*G;return b},toRotationMat:function(a,b){b||(b=y.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=F.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10]; -return b},toInverseMat3:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[4],h=a[5],f=a[6],g=a[8],q=a[9],j=a[10],u=j*h-f*q,l=-j*k+f*g,m=q*k-h*g,r=e*u+c*l+d*m;if(!r)return null;r=1/r;b||(b=F.create());b[0]=u*r;b[1]=(-j*c+d*q)*r;b[2]=(f*c-d*h)*r;b[3]=l*r;b[4]=(j*e-d*g)*r;b[5]=(-f*e+d*k)*r;b[6]=m*r;b[7]=(-q*e+c*g)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],f=a[4],g=a[5],q=a[6],j=a[7],u=a[8],l=a[9],m=a[10],r=a[11],p=a[12],t=a[13],s=a[14];a=a[15];var n=b[0], -B=b[1],v=b[2],w=b[3];e[0]=n*c+B*f+v*u+w*p;e[1]=n*d+B*g+v*l+w*t;e[2]=n*k+B*q+v*m+w*s;e[3]=n*h+B*j+v*r+w*a;n=b[4];B=b[5];v=b[6];w=b[7];e[4]=n*c+B*f+v*u+w*p;e[5]=n*d+B*g+v*l+w*t;e[6]=n*k+B*q+v*m+w*s;e[7]=n*h+B*j+v*r+w*a;n=b[8];B=b[9];v=b[10];w=b[11];e[8]=n*c+B*f+v*u+w*p;e[9]=n*d+B*g+v*l+w*t;e[10]=n*k+B*q+v*m+w*s;e[11]=n*h+B*j+v*r+w*a;n=b[12];B=b[13];v=b[14];w=b[15];e[12]=n*c+B*f+v*u+w*p;e[13]=n*d+B*g+v*l+w*t;e[14]=n*k+B*q+v*m+w*s;e[15]=n*h+B*j+v*r+w*a;return e},multiplyVec3:function(a,b,e){e||(e=b); -var c=b[0],d=b[1];b=b[2];e[0]=a[0]*c+a[4]*d+a[8]*b+a[12];e[1]=a[1]*c+a[5]*d+a[9]*b+a[13];e[2]=a[2]*c+a[6]*d+a[10]*b+a[14];return e},multiplyVec4:function(a,b,e){e||(e=b);var c=b[0],d=b[1],k=b[2];b=b[3];e[0]=a[0]*c+a[4]*d+a[8]*k+a[12]*b;e[1]=a[1]*c+a[5]*d+a[9]*k+a[13]*b;e[2]=a[2]*c+a[6]*d+a[10]*k+a[14]*b;e[3]=a[3]*c+a[7]*d+a[11]*k+a[15]*b;return e},translate:function(a,b,e){var c=b[0],d=b[1];b=b[2];var k,h,f,g,q,j,u,l,m,n,p,s;if(!e||a===e)return a[12]=a[0]*c+a[4]*d+a[8]*b+a[12],a[13]=a[1]*c+a[5]*d+ -a[9]*b+a[13],a[14]=a[2]*c+a[6]*d+a[10]*b+a[14],a[15]=a[3]*c+a[7]*d+a[11]*b+a[15],a;k=a[0];h=a[1];f=a[2];g=a[3];q=a[4];j=a[5];u=a[6];l=a[7];m=a[8];n=a[9];p=a[10];s=a[11];e[0]=k;e[1]=h;e[2]=f;e[3]=g;e[4]=q;e[5]=j;e[6]=u;e[7]=l;e[8]=m;e[9]=n;e[10]=p;e[11]=s;e[12]=k*c+q*d+m*b+a[12];e[13]=h*c+j*d+n*b+a[13];e[14]=f*c+u*d+p*b+a[14];e[15]=g*c+l*d+s*b+a[15];return e},scale:function(a,b,e){var c=b[0],d=b[1];b=b[2];if(!e||a===e)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=d,a[5]*=d,a[6]*=d,a[7]*=d,a[8]*=b,a[9]*= -b,a[10]*=b,a[11]*=b,a;e[0]=a[0]*c;e[1]=a[1]*c;e[2]=a[2]*c;e[3]=a[3]*c;e[4]=a[4]*d;e[5]=a[5]*d;e[6]=a[6]*d;e[7]=a[7]*d;e[8]=a[8]*b;e[9]=a[9]*b;e[10]=a[10]*b;e[11]=a[11]*b;e[12]=a[12];e[13]=a[13];e[14]=a[14];e[15]=a[15];return e},rotate:function(a,b,e,c){var d=e[0],k=e[1];e=e[2];var h=Math.sqrt(d*d+k*k+e*e),f,g,q,j,l,m,n,r,p,s,x,y,B,v,w,z,A,C,D,F;if(!h)return null;1!==h&&(h=1/h,d*=h,k*=h,e*=h);f=Math.sin(b);g=Math.cos(b);q=1-g;b=a[0];h=a[1];j=a[2];l=a[3];m=a[4];n=a[5];r=a[6];p=a[7];s=a[8];x=a[9];y= -a[10];B=a[11];v=d*d*q+g;w=k*d*q+e*f;z=e*d*q-k*f;A=d*k*q-e*f;C=k*k*q+g;D=e*k*q+d*f;F=d*e*q+k*f;d=k*e*q-d*f;k=e*e*q+g;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=b*v+m*w+s*z;c[1]=h*v+n*w+x*z;c[2]=j*v+r*w+y*z;c[3]=l*v+p*w+B*z;c[4]=b*A+m*C+s*D;c[5]=h*A+n*C+x*D;c[6]=j*A+r*C+y*D;c[7]=l*A+p*C+B*D;c[8]=b*F+m*d+s*k;c[9]=h*F+n*d+x*k;c[10]=j*F+r*d+y*k;c[11]=l*F+p*d+B*k;return c},rotateX:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[4],k=a[5],h=a[6],f=a[7],g=a[8],q=a[9],j=a[10], -l=a[11];e?a!==e&&(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[4]=d*b+g*c;e[5]=k*b+q*c;e[6]=h*b+j*c;e[7]=f*b+l*c;e[8]=d*-c+g*b;e[9]=k*-c+q*b;e[10]=h*-c+j*b;e[11]=f*-c+l*b;return e},rotateY:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[8],j=a[9],l=a[10],m=a[11];e?a!==e&&(e[4]=a[4],e[5]=a[5],e[6]=a[6],e[7]=a[7],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*-c;e[1]=k*b+j*-c;e[2]=h*b+l*-c;e[3]=f* -b+m*-c;e[8]=d*c+g*b;e[9]=k*c+j*b;e[10]=h*c+l*b;e[11]=f*c+m*b;return e},rotateZ:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[4],j=a[5],l=a[6],m=a[7];e?a!==e&&(e[8]=a[8],e[9]=a[9],e[10]=a[10],e[11]=a[11],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*c;e[1]=k*b+j*c;e[2]=h*b+l*c;e[3]=f*b+m*c;e[4]=d*-c+g*b;e[5]=k*-c+j*b;e[6]=h*-c+l*b;e[7]=f*-c+m*b;return e},frustum:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2*d/f;h[1]=0; -h[2]=0;h[3]=0;h[4]=0;h[5]=2*d/g;h[6]=0;h[7]=0;h[8]=(b+a)/f;h[9]=(c+e)/g;h[10]=-(k+d)/j;h[11]=-1;h[12]=0;h[13]=0;h[14]=-(2*k*d)/j;h[15]=0;return h},perspective:function(a,b,e,c,d){a=e*Math.tan(a*Math.PI/360);b*=a;return y.frustum(-b,b,-a,a,e,c,d)},ortho:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2/f;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/g;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/j;h[11]=0;h[12]=-(a+b)/f;h[13]=-(c+e)/g;h[14]=-(k+d)/j;h[15]=1;return h},lookAt:function(a,b,e,c){c|| -(c=y.create());var d,k,h,f,g,j,l,m,n=a[0],p=a[1];a=a[2];h=e[0];f=e[1];k=e[2];l=b[0];e=b[1];d=b[2];if(n===l&&p===e&&a===d)return y.identity(c);b=n-l;e=p-e;l=a-d;m=1/Math.sqrt(b*b+e*e+l*l);b*=m;e*=m;l*=m;d=f*l-k*e;k=k*b-h*l;h=h*e-f*b;(m=Math.sqrt(d*d+k*k+h*h))?(m=1/m,d*=m,k*=m,h*=m):h=k=d=0;f=e*h-l*k;g=l*d-b*h;j=b*k-e*d;(m=Math.sqrt(f*f+g*g+j*j))?(m=1/m,f*=m,g*=m,j*=m):j=g=f=0;c[0]=d;c[1]=f;c[2]=b;c[3]=0;c[4]=k;c[5]=g;c[6]=e;c[7]=0;c[8]=h;c[9]=j;c[10]=l;c[11]=0;c[12]=-(d*n+k*p+h*a);c[13]=-(f*n+g*p+ -j*a);c[14]=-(b*n+e*p+l*a);c[15]=1;return c},fromRotationTranslation:function(a,b,e){e||(e=y.create());var c=a[0],d=a[1],k=a[2],h=a[3],f=c+c,g=d+d,j=k+k;a=c*f;var l=c*g,c=c*j,m=d*g,d=d*j,k=k*j,f=h*f,g=h*g,h=h*j;e[0]=1-(m+k);e[1]=l+h;e[2]=c-g;e[3]=0;e[4]=l-h;e[5]=1-(a+k);e[6]=d+f;e[7]=0;e[8]=c+g;e[9]=d-f;e[10]=1-(a+m);e[11]=0;e[12]=b[0];e[13]=b[1];e[14]=b[2];e[15]=1;return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ -a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},s={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,e,c){var d=new l(4);d[0]=a;d[1]=b;d[2]=e;d[3]=c;return d},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=s.create()); -a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},O=s.identity();s.calculateW=function(a,b){var e=a[0],c=a[1],d=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d)),a;b[0]=e;b[1]=c;b[2]=d;b[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d));return b};s.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};s.inverse=function(a,b){var e=a[0],c=a[1],d=a[2],f=a[3],e=(e=e*e+c*c+d*d+f*f)?1/e:0;if(!b||a===b)return a[0]*=-e,a[1]*=-e,a[2]*=-e,a[3]*=e,a;b[0]=-a[0]*e;b[1]=-a[1]*e;b[2]=-a[2]*e;b[3]=a[3]*e; -return b};s.conjugate=function(a,b){if(!b||a===b)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};s.length=function(a){var b=a[0],e=a[1],c=a[2];a=a[3];return Math.sqrt(b*b+e*e+c*c+a*a)};s.normalize=function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],f=a[3],h=Math.sqrt(e*e+c*c+d*d+f*f);if(0===h)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;h=1/h;b[0]=e*h;b[1]=c*h;b[2]=d*h;b[3]=f*h;return b};s.add=function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+= -b[3],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];e[3]=a[3]+b[3];return e};s.multiply=function(a,b,e){e||(e=a);var c=a[0],d=a[1],f=a[2];a=a[3];var h=b[0],g=b[1],j=b[2];b=b[3];e[0]=c*b+a*h+d*j-f*g;e[1]=d*b+a*g+f*h-c*j;e[2]=f*b+a*j+c*g-d*h;e[3]=a*b-c*h-d*g-f*j;return e};s.multiplyVec3=function(a,b,e){e||(e=b);var c=b[0],d=b[1],f=b[2];b=a[0];var h=a[1],g=a[2];a=a[3];var j=a*c+h*f-g*d,l=a*d+g*c-b*f,m=a*f+b*d-h*c,c=-b*c-h*d-g*f;e[0]=j*a+c*-b+l*-g-m*-h;e[1]=l*a+c*-h+m*-b-j*-g;e[2]=m*a+c*-g+j*-h-l*-b; -return e};s.scale=function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a[3]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;e[3]=a[3]*b;return e};s.toMat3=function(a,b){b||(b=F.create());var e=a[0],c=a[1],d=a[2],f=a[3],h=e+e,g=c+c,j=d+d,l=e*h,m=e*g,e=e*j,n=c*g,c=c*j,d=d*j,h=f*h,g=f*g,f=f*j;b[0]=1-(n+d);b[1]=m+f;b[2]=e-g;b[3]=m-f;b[4]=1-(l+d);b[5]=c+h;b[6]=e+g;b[7]=c-h;b[8]=1-(l+n);return b};s.toMat4=function(a,b){b||(b=y.create());var e=a[0],c=a[1],d=a[2],f=a[3],g=e+e,j=c+c,l=d+d,m=e*g,n=e*j,e=e* -l,p=c*j,c=c*l,d=d*l,g=f*g,j=f*j,f=f*l;b[0]=1-(p+d);b[1]=n+f;b[2]=e-j;b[3]=0;b[4]=n-f;b[5]=1-(m+d);b[6]=c+g;b[7]=0;b[8]=e+j;b[9]=c-g;b[10]=1-(m+p);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};s.slerp=function(a,b,c,d){d||(d=a);var f=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],g,h;if(1<=Math.abs(f))return d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d;g=Math.acos(f);h=Math.sqrt(1-f*f);if(0.001>Math.abs(h))return d[0]=0.5*a[0]+0.5*b[0],d[1]=0.5*a[1]+0.5*b[1],d[2]=0.5*a[2]+0.5*b[2],d[3]=0.5*a[3]+ -0.5*b[3],d;f=Math.sin((1-c)*g)/h;c=Math.sin(c*g)/h;d[0]=a[0]*f+b[0]*c;d[1]=a[1]*f+b[1]*c;d[2]=a[2]*f+b[2]*c;d[3]=a[3]*f+b[3]*c;return d};s.fromRotationMatrix=function(a,b){b||(b=s.create());var c=a[0]+a[4]+a[8],d;if(0a[0]&&(c=1);a[8]>a[3*c+c]&&(c=2);var f=d[c],g=d[f];d=Math.sqrt(a[3*c+c]-a[3*f+f]-a[3*g+g]+1);b[c]=0.5*d;d= -0.5/d;b[3]=(a[3*g+f]-a[3*f+g])*d;b[f]=(a[3*f+c]+a[3*c+f])*d;b[g]=(a[3*g+c]+a[3*c+g])*d}return b};F.toQuat4=s.fromRotationMatrix;var D=F.create();s.fromAxes=function(a,b,c,d){D[0]=b[0];D[3]=b[1];D[6]=b[2];D[1]=c[0];D[4]=c[1];D[7]=c[2];D[2]=a[0];D[5]=a[1];D[8]=a[2];return s.fromRotationMatrix(D,d)};s.identity=function(a){a||(a=s.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};s.fromAngleAxis=function(a,b,c){c||(c=s.create());a*=0.5;var d=Math.sin(a);c[3]=Math.cos(a);c[0]=d*b[0];c[1]=d*b[1];c[2]=d*b[2]; -return c};s.toAngleAxis=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); -b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 -Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],f=a[2],g=a[3],h=c*g-f*d;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-d*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, -b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];c[0]=d*b[0]+f*b[2];c[1]=d*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=d*b+f*h;c[1]=d*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var d=b[0];b=b[1];c[0]=d*a[0]+b*a[1];c[1]=d*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var d=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=d*b;c[2]=f*h;c[3]= -g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,d){var f=new l(4);f[0]=a;f[1]=b;f[2]=c;f[3]=d;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, -b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| -(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)},squaredLength:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};c&&(c.glMatrixArrayType=l,c.MatrixArray=l,c.setMatrixArrayType=d,c.determineMatrixArrayType= -f,c.glMath=g,c.vec2=M,c.vec3=j,c.vec4=N,c.mat2=L,c.mat3=F,c.mat4=y,c.quat4=s);return{glMatrixArrayType:l,MatrixArray:l,setMatrixArrayType:d,determineMatrixArrayType:f,glMath:g,vec2:M,vec3:j,vec4:N,mat2:L,mat3:F,mat4:y,quat4:s}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * vColor;","}"]; -PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"]; -PIXI.CompileVertexShader=function(c,d){for(var f="",g=0;g 0) { - this.checkVisibility(child); + this.checkVisibility(child, actualVisibility); } + + }; } -/** - * @private - */ -PIXI.WebGLRenderer.prototype.setGLVisible = function(displayObject, visibility) -{ - var children = displayObject.children; - - for (var i=0; i < children.length; i++) - { - var child = children[i]; - - if(visibility) - { - this.addDisplayObject(child); - } - else - { - this.removeDisplayObject(child); - } - - if(child.children.length > 0) - { - this.setGLVisible(child, visibility); - } - } - -} - /** * Renders the stage to its webGL view - * @param the PIXI.Stage element to be rendered + * @method render + * @param stage {Stage} the PIXI.Stage element to be rendered */ PIXI.WebGLRenderer.prototype.render = function(stage) { @@ -185,9 +164,18 @@ // update children if need be // best to remove first! - for (var i=0; i < stage.__childrenRemoved.length; i++) this.removeDisplayObject(stage.__childrenRemoved[i]); + for (var i=0; i < stage.__childrenRemoved.length; i++) + { + this.removeDisplayObject(stage.__childrenRemoved[i]); + // stage.__childrenRemoved[i].cacheVisible = false; + } + /* // no add all new sprites - for (var i=0; i < stage.__childrenAdded.length; i++) this.addDisplayObject(stage.__childrenAdded[i]); + for (var i=0; i < stage.__childrenAdded.length; i++) + { + stage.__childrenAdded[i].cacheVisible = false; +// this.addDisplayObject(stage.__childrenAdded[i]); + }*/ // update any textures for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]); @@ -197,7 +185,7 @@ PIXI.texturesToUpdate = []; // recursivly loop through all items! - this.checkVisibility(stage); + this.checkVisibility(stage, true); // update the scen graph stage.updateTransform(); @@ -206,7 +194,7 @@ gl.clear(gl.COLOR_BUFFER_BIT) - gl.clearColor(1, 1, 1, 1.0); + gl.clearColor(0, 0, 0, 1.0); // set the correct blend mode! gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); @@ -265,12 +253,16 @@ */ PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject) { - if(!displayObject.stage)return; - displayObject.cacheVisible = displayObject.visible; + if(!displayObject.stage)return; // means it was removed + if(displayObject.__inWebGL)return; //means it is already in webgL - if(!displayObject.visible)return; + //displayObject.cacheVisible = displayObject.visible; + + // TODO if objects parent is not visible then dont add to stage!!!! + //if(!displayObject.visible)return; + displayObject.batch = null; //displayObject.cacheVisible = true; @@ -458,10 +450,12 @@ PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject) { //if(displayObject.stage)return; - displayObject.cacheVisible = displayObject.visible; + displayObject.cacheVisible = false;//displayObject.visible; if(!displayObject.renderable)return; + displayObject.__inWebGL = false; + /* * removing is a lot quicker.. * @@ -472,9 +466,11 @@ { // should always have a batch! var batch = displayObject.batch; - if(!batch)return; // thismeans the display list has been altered befre rendering + if(!batch)return; // this means the display list has been altered befre rendering batch.remove(displayObject); + + if(batch.size==0) { batchToRemove = batch @@ -528,8 +524,9 @@ /** * resizes the webGL view to the specified width and height - * @param the new width of the webGL view - * @param the new height of the webGL view + * @method resize + * @param width {Number} the new width of the webGL view + * @param height {Number} the new height of the webGL view */ PIXI.WebGLRenderer.prototype.resize = function(width, height) { diff --git a/src/pixi/renderers/WebGLShaders.js b/src/pixi/renderers/WebGLShaders.js index 8a109dc..b717256 100644 --- a/src/pixi/renderers/WebGLShaders.js +++ b/src/pixi/renderers/WebGLShaders.js @@ -2,7 +2,6 @@ /** * @author Mat Groves http://matgroves.com/ */ -var PIXI = PIXI || {}; PIXI.shaderFragmentSrc = [ "precision mediump float;", "varying vec2 vTextureCoord;", diff --git a/src/pixi/textures/BaseTexture.js b/src/pixi/textures/BaseTexture.js index 0d2221d..a3fdce7 100644 --- a/src/pixi/textures/BaseTexture.js +++ b/src/pixi/textures/BaseTexture.js @@ -1,17 +1,16 @@ /** * @author Mat Groves http://matgroves.com/ */ -var PIXI = PIXI || {}; PIXI.BaseTextureCache = {}; PIXI.texturesToUpdate = []; /** - * @class A texture stores the information that represents an image. All textures have a base texture - * @augments PIXI.EventTarget + * A texture stores the information that represents an image. All textures have a base texture + * @class BaseTexture + * @extends EventTarget * @constructor - * @param image url - * @return A new BaseTexture + * @param imageUrl {String} image url */ PIXI.BaseTexture = function(imageUrl) { @@ -19,13 +18,15 @@ /** * The url of the texture - * @type #BaseTexture + * @property imageUrl + * @type String */ this.imageUrl = imageUrl; /** * The html image that is loaded to create the texture - * @type #BaseTexture + * @property image + * @type Image */ this.image = new Image(); @@ -41,17 +42,19 @@ scope.dispatchEvent( { type: 'loaded', content: scope } ); } - $.proxy(this.onImageLoaded, this); + $.proxy(this.onImageLoaded, this); this.image.src = imageUrl; /** * [read only] The width of the base texture set when the image has loaded - * @type #BaseTexture + * @property width + * @type Number */ this.width = 100; /** * [read only] The height of the base texture set when the image has loaded - * @type #BaseTexture + * @property height + * @type Number */ this.height = 100; diff --git a/src/pixi/textures/Texture.js b/src/pixi/textures/Texture.js index e46fd9f..3f6457a 100644 --- a/src/pixi/textures/Texture.js +++ b/src/pixi/textures/Texture.js @@ -1,18 +1,17 @@ /** * @author Mat Groves http://matgroves.com/ */ -var PIXI = PIXI || {}; PIXI.TextureCache = {}; PIXI.FrameCache = {}; /** - * @class A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used - * @augments PIXI.EventTarget + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used + * @class Texture + * @extends EventTarget * @constructor - * @param {PIXI.textures.BaseTexture} base texture {@link PIXI.textures.BaseTexture} - * @param {PIXI.Rectangle} frame {@link PIXI.Rectangle} - * @return A new Texture. + * @param baseTexture {BaseTexture} + * @param frmae {Rectangle} */ PIXI.Texture = function(baseTexture, frame) { @@ -24,9 +23,12 @@ frame = new PIXI.Rectangle(0,0,1,1); } + this.trim = new PIXI.Point(); + /** * The base texture of this texture - * @type #BaseTexture + * @property baseTexture + * @type BaseTexture */ this.baseTexture = baseTexture; @@ -34,6 +36,7 @@ /** * The frame specifies the region of the base texture that this texture uses + * @property frame * @type #Rectangle */ this.frame = frame; @@ -71,8 +74,8 @@ /** * Specifies the rectangle region of the baseTexture - * @param {PIXI.Rectangle} frame {@link PIXI.Rectangle} - * @return A new Texture. + * @method setFrame + * @param frame {Rectangle} */ PIXI.Texture.prototype.setFrame = function(frame) { @@ -86,8 +89,10 @@ * * Helper function that returns a texture based on an image url * If the image is not in the texture cache it will be created and loaded - * @param The image url of the texture - * @return {PIXI.textures.Texture} texture {@link PIXI.textures.Texture} + * @static + * @method fromImage + * @param imageUrl {String} The image url of the texture + * @return Texture */ PIXI.Texture.fromImage = function(imageUrl) { @@ -108,21 +113,23 @@ * * Helper function that returns a texture based on a frame id * If the frame id is not in the texture cache an error will be thrown - * @param The frame id of the texture - * @return {PIXI.textures.Texture} texture {@link PIXI.textures.Texture} + * @method fromFrameId + * @param frameId {String} The frame id of the texture + * @return Texture */ PIXI.Texture.fromFrameId = function(frameId) { var texture = PIXI.TextureCache[frameId]; - if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this); + if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this); return texture; } /** * * Adds a texture to the textureCache. - * @param {PIXI.textures.Texture} texture {@link PIXI.textures.Texture} - * @param the id that the texture will be stored against. + * @method addTextureToCache + * @param texture {Texture} + * @param id {String} the id that the texture will be stored against. */ PIXI.Texture.addTextureToCache = function(texture, id) { @@ -132,9 +139,10 @@ /** * * Remove a texture from the textureCache. - * @param the id of the texture to be removed + * @method removeTextureFromCache + * @param id {String} the id of the texture to be removed */ -PIXI.Texture.addTextureToCache = function(id) +PIXI.Texture.removeTextureFromCache = function(id) { PIXI.TextureCache[id] = texture; } diff --git a/src/pixi/utils/Detector.js b/src/pixi/utils/Detector.js index 9450e44..b086f12 100644 --- a/src/pixi/utils/Detector.js +++ b/src/pixi/utils/Detector.js @@ -1,14 +1,14 @@ /** * @author Mat Groves http://matgroves.com/ */ -var PIXI = PIXI || {}; /** * This helper function will automatically detect which renderer you should be using. * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer - * @param the width of the renderers view - * @param the height of the renderers view - * @return A new Renderer + * @method autoDetectRenderer + * @static + * @param width {Number} the width of the renderers view + * @param height {Number} the height of the renderers view */ PIXI.autoDetectRenderer = function(width, height) { diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/examples/bunny benchmark/index.html b/examples/bunny benchmark/index.html index 7c5521b..95972c4 100644 --- a/examples/bunny benchmark/index.html +++ b/examples/bunny benchmark/index.html @@ -9,9 +9,10 @@ +
    Click to add more bunnys! Let me know how many you get on screen here @doormat23
    - + diff --git a/examples/bunny benchmark/js/bunnyBenchMark.js b/examples/bunny benchmark/js/bunnyBenchMark.js index a3154eb..c3c8ec5 100644 --- a/examples/bunny benchmark/js/bunnyBenchMark.js +++ b/examples/bunny benchmark/js/bunnyBenchMark.js @@ -22,18 +22,13 @@ var count = 0; var container; +var detail; + function onReady() { - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() + detail = document.getElementById("pixi"); - if(webgl) - { - renderer = new PIXI.WebGLRenderer(); - } - else - { - renderer = new PIXI.CanvasRenderer(480, 320); - } + renderer = PIXI.autoDetectRenderer(); stage = new PIXI.Stage; @@ -46,7 +41,7 @@ stats.domElement.style.top = "0px"; requestAnimFrame(update); - wabbitTexture = new PIXI.Texture("wabbit.png") + wabbitTexture = new PIXI.Texture.fromImage("wabbit.png") counter = document.createElement("div"); counter.className = "counter"; @@ -55,7 +50,6 @@ count = startBunnyCount; counter.innerHTML = count + " BUNNIES"; - container = new PIXI.DisplayObjectContainer(); stage.addChild(container); @@ -114,7 +108,9 @@ minX = 0; maxY = height; minY = 0; - + + detail.style.left = width - 204 + "px"; + detail.style.top = height - 100 + "px"; renderer.resize(width, height); } @@ -126,17 +122,17 @@ { // add 10 at a time :) - for (var i = 0; i < 2; i++) + for (var i = 0; i < 10; i++) { - var bunny = new PIXI.Sprite(wabbitTexture, {x:0, y:0, width:26, height:37}); + var bunny = new PIXI.Sprite(wabbitTexture); bunny.speedX = Math.random() * 10; bunny.speedY = (Math.random() * 10) - 5; bunny.anchor.x = 0.5; bunny.anchor.y = 1; - bunny.alpha = 0.3 + Math.random() * 0.7; + //bunny.alpha = 0.3 + Math.random() * 0.7; bunnys.push(bunny); - bunny.rotation = Math.random() - 0.5; + //bunny.rotation = Math.random() - 0.5; container.addChild(bunny); count++; diff --git a/examples/bunny benchmark/js/pixi.js b/examples/bunny benchmark/js/pixi.js new file mode 100644 index 0000000..65add09 --- /dev/null +++ b/examples/bunny benchmark/js/pixi.js @@ -0,0 +1,110 @@ +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, +d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* +j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= +a[0]-d[0],c=a[1]-d[1];a=a[2]-d[2];d=Math.sqrt(b*b+c*c+a*a);if(!d)return j[0]=0,j[1]=0,j[2]=0,j;d=1/d;j[0]=b*d;j[1]=c*d;j[2]=a*d;return j},lerp:function(a,d,j,b){b||(b=a);b[0]=a[0]+j*(d[0]-a[0]);b[1]=a[1]+j*(d[1]-a[1]);b[2]=a[2]+j*(d[2]-a[2]);return b},dist:function(a,d){var j=d[0]-a[0],b=d[1]-a[1],c=d[2]-a[2];return Math.sqrt(j*j+b*b+c*c)}},p=null,q=new k(4);l.unproject=function(a,d,j,b,c){c||(c=a);p||(p=t.create());var e=p;q[0]=2*(a[0]-b[0])/b[2]-1;q[1]=2*(a[1]-b[1])/b[3]-1;q[2]=2*a[2]-1;q[3]=1; +t.multiply(j,d,e);if(!t.inverse(e))return null;t.multiplyVec4(e,q);if(0===q[3])return null;c[0]=q[0]/q[3];c[1]=q[1]/q[3];c[2]=q[2]/q[3];return c};var C=l.createFrom(1,0,0),F=l.createFrom(0,1,0),u=l.createFrom(0,0,1),w=l.create();l.rotationTo=function(a,d,j){j||(j=m.create());var b=l.dot(a,d);if(1<=b)m.set(H,j);else if(-0.999999>b)l.cross(C,a,w),1E-6>l.length(w)&&l.cross(F,a,w),1E-6>l.length(w)&&l.cross(u,a,w),l.normalize(w),m.fromAngleAxis(Math.PI,w,j);else{var b=Math.sqrt(2*(1+b)),c=1/b;l.cross(a, +d,w);j[0]=w[0]*c;j[1]=w[1]*c;j[2]=w[2]*c;j[3]=0.5*b;m.normalize(j)}1j[3]&&(j[3]=-1);return j};l.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var x={create:function(a){var d=new k(9);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8]):d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=0;return d},createFrom:function(a,d,j,b,c,e,n,f,E){var s=new k(9);s[0]=a;s[1]=d;s[2]=j;s[3]=b;s[4]=c;s[5]=e;s[6]=n;s[7]=f;s[8]=E;return s},determinant:function(a){var d= +a[3],j=a[4],b=a[5],c=a[6],e=a[7],n=a[8];return a[0]*(n*j-b*e)+a[1]*(-n*d+b*c)+a[2]*(e*d-j*c)},inverse:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[3],n=a[4],f=a[5],E=a[6],s=a[7],I=a[8],g=I*n-f*s,h=-I*e+f*E,k=s*e-n*E,r=j*g+b*h+c*k;if(!r)return null;r=1/r;d||(d=x.create());d[0]=g*r;d[1]=(-I*b+c*s)*r;d[2]=(f*b-c*n)*r;d[3]=h*r;d[4]=(I*j-c*E)*r;d[5]=(-f*j+c*e)*r;d[6]=k*r;d[7]=(-s*j+b*E)*r;d[8]=(n*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],D=a[4],E=a[5],s=a[6],I= +a[7];a=a[8];var g=d[0],h=d[1],k=d[2],r=d[3],m=d[4],l=d[5],q=d[6],v=d[7];d=d[8];j[0]=g*b+h*f+k*s;j[1]=g*c+h*D+k*I;j[2]=g*e+h*E+k*a;j[3]=r*b+m*f+l*s;j[4]=r*c+m*D+l*I;j[5]=r*e+m*E+l*a;j[6]=q*b+v*f+d*s;j[7]=q*c+v*D+d*I;j[8]=q*e+v*E+d*a;return j},multiplyVec2:function(a,d,j){j||(j=d);var b=d[0];d=d[1];j[0]=b*a[0]+d*a[3]+a[6];j[1]=b*a[1]+d*a[4]+a[7];return j},multiplyVec3:function(a,d,j){j||(j=d);var b=d[0],c=d[1];d=d[2];j[0]=b*a[0]+c*a[3]+d*a[6];j[1]=b*a[1]+c*a[4]+d*a[7];j[2]=b*a[2]+c*a[5]+d*a[8];return j}, +set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])},identity:function(a){a||(a=x.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, +d){if(!d||a===d){var j=a[1],b=a[2],c=a[5];a[1]=a[3];a[2]=a[6];a[3]=j;a[5]=a[7];a[6]=b;a[7]=c;return a}d[0]=a[0];d[1]=a[3];d[2]=a[6];d[3]=a[1];d[4]=a[4];d[5]=a[7];d[6]=a[2];d[7]=a[5];d[8]=a[8];return d},toMat4:function(a,d){d||(d=t.create());d[15]=1;d[14]=0;d[13]=0;d[12]=0;d[11]=0;d[10]=a[8];d[9]=a[7];d[8]=a[6];d[7]=0;d[6]=a[5];d[5]=a[4];d[4]=a[3];d[3]=0;d[2]=a[2];d[1]=a[1];d[0]=a[0];return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ +a[8]+"]"}},t={create:function(a){var d=new k(16);a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8],d[9]=a[9],d[10]=a[10],d[11]=a[11],d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d},createFrom:function(a,d,j,b,c,e,f,D,E,s,g,h,m,l,r,q){var A=new k(16);A[0]=a;A[1]=d;A[2]=j;A[3]=b;A[4]=c;A[5]=e;A[6]=f;A[7]=D;A[8]=E;A[9]=s;A[10]=g;A[11]=h;A[12]=m;A[13]=l;A[14]=r;A[15]=q;return A},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4]; +d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=a[12];d[13]=a[13];d[14]=a[14];d[15]=a[15];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])&&1E-6>Math.abs(a[9]-d[9])&&1E-6>Math.abs(a[10]-d[10])&&1E-6>Math.abs(a[11]-d[11])&&1E-6>Math.abs(a[12]- +d[12])&&1E-6>Math.abs(a[13]-d[13])&&1E-6>Math.abs(a[14]-d[14])&&1E-6>Math.abs(a[15]-d[15])},identity:function(a){a||(a=t.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,d){if(!d||a===d){var j=a[1],b=a[2],c=a[3],e=a[6],f=a[7],D=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=j;a[6]=a[9];a[7]=a[13];a[8]=b;a[9]=e;a[11]=a[14];a[12]=c;a[13]=f;a[14]=D;return a}d[0]=a[0];d[1]=a[4];d[2]=a[8];d[3]=a[12]; +d[4]=a[1];d[5]=a[5];d[6]=a[9];d[7]=a[13];d[8]=a[2];d[9]=a[6];d[10]=a[10];d[11]=a[14];d[12]=a[3];d[13]=a[7];d[14]=a[11];d[15]=a[15];return d},determinant:function(a){var d=a[0],j=a[1],b=a[2],c=a[3],e=a[4],f=a[5],D=a[6],E=a[7],s=a[8],g=a[9],h=a[10],k=a[11],m=a[12],r=a[13],l=a[14];a=a[15];return m*g*D*c-s*r*D*c-m*f*h*c+e*r*h*c+s*f*l*c-e*g*l*c-m*g*b*E+s*r*b*E+m*j*h*E-d*r*h*E-s*j*l*E+d*g*l*E+m*f*b*k-e*r*b*k-m*j*D*k+d*r*D*k+e*j*l*k-d*f*l*k-s*f*b*a+e*g*b*a+s*j*D*a-d*g*D*a-e*j*h*a+d*f*h*a},inverse:function(a, +d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=a[3],f=a[4],D=a[5],E=a[6],s=a[7],g=a[8],h=a[9],k=a[10],m=a[11],r=a[12],l=a[13],A=a[14],q=a[15],v=j*D-b*f,J=j*E-c*f,y=j*s-e*f,z=b*E-c*D,t=b*s-e*D,u=c*s-e*E,p=g*l-h*r,w=g*A-k*r,x=g*q-m*r,B=h*A-k*l,C=h*q-m*l,F=k*q-m*A,G=v*F-J*C+y*B+z*x-t*w+u*p;if(!G)return null;G=1/G;d[0]=(D*F-E*C+s*B)*G;d[1]=(-b*F+c*C-e*B)*G;d[2]=(l*u-A*t+q*z)*G;d[3]=(-h*u+k*t-m*z)*G;d[4]=(-f*F+E*x-s*w)*G;d[5]=(j*F-c*x+e*w)*G;d[6]=(-r*u+A*y-q*J)*G;d[7]=(g*u-k*y+m*J)*G;d[8]=(f*C-D*x+s*p)*G;d[9]= +(-j*C+b*x-e*p)*G;d[10]=(r*t-l*y+q*v)*G;d[11]=(-g*t+h*y-m*v)*G;d[12]=(-f*B+D*w-E*p)*G;d[13]=(j*B-b*w+c*p)*G;d[14]=(-r*z+l*J-A*v)*G;d[15]=(g*z-h*J+k*v)*G;return d},toRotationMat:function(a,d){d||(d=t.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d},toMat3:function(a,d){d||(d=x.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[4];d[4]=a[5];d[5]=a[6];d[6]=a[8];d[7]=a[9];d[8]=a[10]; +return d},toInverseMat3:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[4],f=a[5],D=a[6],g=a[8],s=a[9],h=a[10],k=h*f-D*s,m=-h*e+D*g,l=s*e-f*g,r=j*k+b*m+c*l;if(!r)return null;r=1/r;d||(d=x.create());d[0]=k*r;d[1]=(-h*b+c*s)*r;d[2]=(D*b-c*f)*r;d[3]=m*r;d[4]=(h*j-c*g)*r;d[5]=(-D*j+c*e)*r;d[6]=l*r;d[7]=(-s*j+b*g)*r;d[8]=(f*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],s=a[6],k=a[7],m=a[8],l=a[9],q=a[10],r=a[11],t=a[12],A=a[13],u=a[14];a=a[15];var v=d[0], +p=d[1],y=d[2],z=d[3];j[0]=v*b+p*g+y*m+z*t;j[1]=v*c+p*h+y*l+z*A;j[2]=v*e+p*s+y*q+z*u;j[3]=v*f+p*k+y*r+z*a;v=d[4];p=d[5];y=d[6];z=d[7];j[4]=v*b+p*g+y*m+z*t;j[5]=v*c+p*h+y*l+z*A;j[6]=v*e+p*s+y*q+z*u;j[7]=v*f+p*k+y*r+z*a;v=d[8];p=d[9];y=d[10];z=d[11];j[8]=v*b+p*g+y*m+z*t;j[9]=v*c+p*h+y*l+z*A;j[10]=v*e+p*s+y*q+z*u;j[11]=v*f+p*k+y*r+z*a;v=d[12];p=d[13];y=d[14];z=d[15];j[12]=v*b+p*g+y*m+z*t;j[13]=v*c+p*h+y*l+z*A;j[14]=v*e+p*s+y*q+z*u;j[15]=v*f+p*k+y*r+z*a;return j},multiplyVec3:function(a,d,b){b||(b=d); +var c=d[0],e=d[1];d=d[2];b[0]=a[0]*c+a[4]*e+a[8]*d+a[12];b[1]=a[1]*c+a[5]*e+a[9]*d+a[13];b[2]=a[2]*c+a[6]*e+a[10]*d+a[14];return b},multiplyVec4:function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=d[3];b[0]=a[0]*c+a[4]*e+a[8]*f+a[12]*d;b[1]=a[1]*c+a[5]*e+a[9]*f+a[13]*d;b[2]=a[2]*c+a[6]*e+a[10]*f+a[14]*d;b[3]=a[3]*c+a[7]*e+a[11]*f+a[15]*d;return b},translate:function(a,d,b){var c=d[0],e=d[1];d=d[2];var f,n,g,h,s,k,m,l,p,r,q,t;if(!b||a===b)return a[12]=a[0]*c+a[4]*e+a[8]*d+a[12],a[13]=a[1]*c+a[5]*e+ +a[9]*d+a[13],a[14]=a[2]*c+a[6]*e+a[10]*d+a[14],a[15]=a[3]*c+a[7]*e+a[11]*d+a[15],a;f=a[0];n=a[1];g=a[2];h=a[3];s=a[4];k=a[5];m=a[6];l=a[7];p=a[8];r=a[9];q=a[10];t=a[11];b[0]=f;b[1]=n;b[2]=g;b[3]=h;b[4]=s;b[5]=k;b[6]=m;b[7]=l;b[8]=p;b[9]=r;b[10]=q;b[11]=t;b[12]=f*c+s*e+p*d+a[12];b[13]=n*c+k*e+r*d+a[13];b[14]=g*c+m*e+q*d+a[14];b[15]=h*c+l*e+t*d+a[15];return b},scale:function(a,d,b){var c=d[0],e=d[1];d=d[2];if(!b||a===b)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=d,a[9]*= +d,a[10]*=d,a[11]*=d,a;b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[7]=a[7]*e;b[8]=a[8]*d;b[9]=a[9]*d;b[10]=a[10]*d;b[11]=a[11]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},rotate:function(a,d,b,c){var e=b[0],f=b[1];b=b[2];var n=Math.sqrt(e*e+f*f+b*b),g,h,k,m,l,p,q,r,t,u,w,v,x,y,z,B,C,F,H,K;if(!n)return null;1!==n&&(n=1/n,e*=n,f*=n,b*=n);g=Math.sin(d);h=Math.cos(d);k=1-h;d=a[0];n=a[1];m=a[2];l=a[3];p=a[4];q=a[5];r=a[6];t=a[7];u=a[8];w=a[9];v= +a[10];x=a[11];y=e*e*k+h;z=f*e*k+b*g;B=b*e*k-f*g;C=e*f*k-b*g;F=f*f*k+h;H=b*f*k+e*g;K=e*b*k+f*g;e=f*b*k-e*g;f=b*b*k+h;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=d*y+p*z+u*B;c[1]=n*y+q*z+w*B;c[2]=m*y+r*z+v*B;c[3]=l*y+t*z+x*B;c[4]=d*C+p*F+u*H;c[5]=n*C+q*F+w*H;c[6]=m*C+r*F+v*H;c[7]=l*C+t*F+x*H;c[8]=d*K+p*e+u*f;c[9]=n*K+q*e+w*f;c[10]=m*K+r*e+v*f;c[11]=l*K+t*e+x*f;return c},rotateX:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[4],f=a[5],n=a[6],g=a[7],h=a[8],k=a[9],m=a[10], +l=a[11];b?a!==b&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[4]=e*d+h*c;b[5]=f*d+k*c;b[6]=n*d+m*c;b[7]=g*d+l*c;b[8]=e*-c+h*d;b[9]=f*-c+k*d;b[10]=n*-c+m*d;b[11]=g*-c+l*d;return b},rotateY:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[8],k=a[9],m=a[10],l=a[11];b?a!==b&&(b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*-c;b[1]=f*d+k*-c;b[2]=n*d+m*-c;b[3]=g* +d+l*-c;b[8]=e*c+h*d;b[9]=f*c+k*d;b[10]=n*c+m*d;b[11]=g*c+l*d;return b},rotateZ:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[4],k=a[5],m=a[6],l=a[7];b?a!==b&&(b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*c;b[1]=f*d+k*c;b[2]=n*d+m*c;b[3]=g*d+l*c;b[4]=e*-c+h*d;b[5]=f*-c+k*d;b[6]=n*-c+m*d;b[7]=g*-c+l*d;return b},frustum:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2*e/g;n[1]=0; +n[2]=0;n[3]=0;n[4]=0;n[5]=2*e/h;n[6]=0;n[7]=0;n[8]=(d+a)/g;n[9]=(c+b)/h;n[10]=-(f+e)/k;n[11]=-1;n[12]=0;n[13]=0;n[14]=-(2*f*e)/k;n[15]=0;return n},perspective:function(a,d,b,c,e){a=b*Math.tan(a*Math.PI/360);d*=a;return t.frustum(-d,d,-a,a,b,c,e)},ortho:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2/g;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=2/h;n[6]=0;n[7]=0;n[8]=0;n[9]=0;n[10]=-2/k;n[11]=0;n[12]=-(a+d)/g;n[13]=-(c+b)/h;n[14]=-(f+e)/k;n[15]=1;return n},lookAt:function(a,d,b,c){c|| +(c=t.create());var e,f,n,g,h,k,m,l,p=a[0],q=a[1];a=a[2];n=b[0];g=b[1];f=b[2];m=d[0];b=d[1];e=d[2];if(p===m&&q===b&&a===e)return t.identity(c);d=p-m;b=q-b;m=a-e;l=1/Math.sqrt(d*d+b*b+m*m);d*=l;b*=l;m*=l;e=g*m-f*b;f=f*d-n*m;n=n*b-g*d;(l=Math.sqrt(e*e+f*f+n*n))?(l=1/l,e*=l,f*=l,n*=l):n=f=e=0;g=b*n-m*f;h=m*e-d*n;k=d*f-b*e;(l=Math.sqrt(g*g+h*h+k*k))?(l=1/l,g*=l,h*=l,k*=l):k=h=g=0;c[0]=e;c[1]=g;c[2]=d;c[3]=0;c[4]=f;c[5]=h;c[6]=b;c[7]=0;c[8]=n;c[9]=k;c[10]=m;c[11]=0;c[12]=-(e*p+f*q+n*a);c[13]=-(g*p+h*q+ +k*a);c[14]=-(d*p+b*q+m*a);c[15]=1;return c},fromRotationTranslation:function(a,d,b){b||(b=t.create());var c=a[0],e=a[1],f=a[2],n=a[3],g=c+c,h=e+e,k=f+f;a=c*g;var l=c*h,c=c*k,m=e*h,e=e*k,f=f*k,g=n*g,h=n*h,n=n*k;b[0]=1-(m+f);b[1]=l+n;b[2]=c-h;b[3]=0;b[4]=l-n;b[5]=1-(a+f);b[6]=e+g;b[7]=0;b[8]=c+h;b[9]=e-g;b[10]=1-(a+m);b[11]=0;b[12]=d[0];b[13]=d[1];b[14]=d[2];b[15]=1;return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ +a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},m={create:function(a){var d=new k(4);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]):d[0]=d[1]=d[2]=d[3]=0;return d},createFrom:function(a,d,b,c){var e=new k(4);e[0]=a;e[1]=d;e[2]=b;e[3]=c;return e},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])},identity:function(a){a||(a=m.create()); +a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},H=m.identity();m.calculateW=function(a,d){var b=a[0],c=a[1],e=a[2];if(!d||a===d)return a[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e)),a;d[0]=b;d[1]=c;d[2]=e;d[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e));return d};m.dot=function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3]};m.inverse=function(a,d){var b=a[0],c=a[1],e=a[2],f=a[3],b=(b=b*b+c*c+e*e+f*f)?1/b:0;if(!d||a===d)return a[0]*=-b,a[1]*=-b,a[2]*=-b,a[3]*=b,a;d[0]=-a[0]*b;d[1]=-a[1]*b;d[2]=-a[2]*b;d[3]=a[3]*b; +return d};m.conjugate=function(a,d){if(!d||a===d)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=a[3];return d};m.length=function(a){var d=a[0],b=a[1],c=a[2];a=a[3];return Math.sqrt(d*d+b*b+c*c+a*a)};m.normalize=function(a,d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=Math.sqrt(b*b+c*c+e*e+f*f);if(0===g)return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d;g=1/g;d[0]=b*g;d[1]=c*g;d[2]=e*g;d[3]=f*g;return d};m.add=function(a,d,b){if(!b||a===b)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a[3]+= +d[3],a;b[0]=a[0]+d[0];b[1]=a[1]+d[1];b[2]=a[2]+d[2];b[3]=a[3]+d[3];return b};m.multiply=function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2];a=a[3];var g=d[0],h=d[1],k=d[2];d=d[3];b[0]=c*d+a*g+e*k-f*h;b[1]=e*d+a*h+f*g-c*k;b[2]=f*d+a*k+c*h-e*g;b[3]=a*d-c*g-e*h-f*k;return b};m.multiplyVec3=function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=a[0];var g=a[1],h=a[2];a=a[3];var k=a*c+g*f-h*e,l=a*e+h*c-d*f,m=a*f+d*e-g*c,c=-d*c-g*e-h*f;b[0]=k*a+c*-d+l*-h-m*-g;b[1]=l*a+c*-g+m*-d-k*-h;b[2]=m*a+c*-h+k*-g-l*-d; +return b};m.scale=function(a,d,b){if(!b||a===b)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a;b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[3]=a[3]*d;return b};m.toMat3=function(a,d){d||(d=x.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b*k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=m-f;d[4]=1-(l+e);d[5]=c+g;d[6]=b+h;d[7]=c-g;d[8]=1-(l+p);return d};m.toMat4=function(a,d){d||(d=t.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b* +k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=0;d[4]=m-f;d[5]=1-(l+e);d[6]=c+g;d[7]=0;d[8]=b+h;d[9]=c-g;d[10]=1-(l+p);d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d};m.slerp=function(a,d,b,c){c||(c=a);var e=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3],f,g;if(1<=Math.abs(e))return c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]),c;f=Math.acos(e);g=Math.sqrt(1-e*e);if(0.0010>Math.abs(g))return c[0]=0.5*a[0]+0.5*d[0],c[1]=0.5*a[1]+0.5*d[1],c[2]=0.5*a[2]+0.5*d[2],c[3]=0.5*a[3]+ +0.5*d[3],c;e=Math.sin((1-b)*f)/g;b=Math.sin(b*f)/g;c[0]=a[0]*e+d[0]*b;c[1]=a[1]*e+d[1]*b;c[2]=a[2]*e+d[2]*b;c[3]=a[3]*e+d[3]*b;return c};m.fromRotationMatrix=function(a,d){d||(d=m.create());var b=a[0]+a[4]+a[8],c;if(0a[0]&&(b=1);a[8]>a[3*b+b]&&(b=2);var e=c[b],f=c[e];c=Math.sqrt(a[3*b+b]-a[3*e+e]-a[3*f+f]+1);d[b]=0.5*c;c= +0.5/c;d[3]=(a[3*f+e]-a[3*e+f])*c;d[e]=(a[3*e+b]+a[3*b+e])*c;d[f]=(a[3*f+b]+a[3*b+f])*c}return d};x.toQuat4=m.fromRotationMatrix;var B=x.create();m.fromAxes=function(a,d,b,c){B[0]=d[0];B[3]=d[1];B[6]=d[2];B[1]=b[0];B[4]=b[1];B[7]=b[2];B[2]=a[0];B[5]=a[1];B[8]=a[2];return m.fromRotationMatrix(B,c)};m.identity=function(a){a||(a=m.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};m.fromAngleAxis=function(a,d,b){b||(b=m.create());a*=0.5;var c=Math.sin(a);b[3]=Math.cos(a);b[0]=c*d[0];b[1]=c*d[1];b[2]=c*d[2]; +return b};m.toAngleAxis=function(a,d){d||(d=a);var b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); +b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 +Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],e=a[1],f=a[2],g=a[3],h=c*g-f*e;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-e*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, +b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];c[0]=e*b[0]+f*b[2];c[1]=e*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=e*b+f*h;c[1]=e*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var e=b[0];b=b[1];c[0]=e*a[0]+b*a[1];c[1]=e*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var e=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=e*b;c[2]=f*h;c[3]= +g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, +b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| +(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= +f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; +PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; +PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l>1);var b=m[0];return b*(1.5-0.5*a*b*b)}}else g.invsqrt=function(a){return 1/Math.sqrt(a)}; -var l=null;f();var j={create:function(a){var b=new l(3);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0;return b},createFrom:function(a,b,e){var c=new l(3);c[0]=a;c[1]=b;c[2]=e;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])},add:function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];return e},subtract:function(a, -b,e){if(!e||a===e)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];return e},multiply:function(a,b,e){if(!e||a===e)return a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a;e[0]=a[0]*b[0];e[1]=a[1]*b[1];e[2]=a[2]*b[2];return e},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;return e},normalize:function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=Math.sqrt(e* -e+c*c+d*d);if(!k)return b[0]=0,b[1]=0,b[2]=0,b;if(1===k)return b[0]=e,b[1]=c,b[2]=d,b;k=1/k;b[0]=e*k;b[1]=c*k;b[2]=d*k;return b},cross:function(a,b,e){e||(e=a);var c=a[0],d=a[1];a=a[2];var k=b[0],h=b[1];b=b[2];e[0]=d*b-a*h;e[1]=a*k-c*b;e[2]=c*h-d*k;return e},length:function(a){var b=a[0],e=a[1];a=a[2];return Math.sqrt(b*b+e*e+a*a)},squaredLength:function(a){var b=a[0],e=a[1];a=a[2];return b*b+e*e+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,b,e){e||(e=a);var c= -a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];b=Math.sqrt(c*c+d*d+a*a);if(!b)return e[0]=0,e[1]=0,e[2]=0,e;b=1/b;e[0]=c*b;e[1]=d*b;e[2]=a*b;return e},lerp:function(a,b,e,c){c||(c=a);c[0]=a[0]+e*(b[0]-a[0]);c[1]=a[1]+e*(b[1]-a[1]);c[2]=a[2]+e*(b[2]-a[2]);return c},dist:function(a,b){var e=b[0]-a[0],c=b[1]-a[1],d=b[2]-a[2];return Math.sqrt(e*e+c*c+d*d)}},x=null,n=new l(4);j.unproject=function(a,b,e,c,d){d||(d=a);x||(x=y.create());var k=x;n[0]=2*(a[0]-c[0])/c[2]-1;n[1]=2*(a[1]-c[1])/c[3]-1;n[2]=2*a[2]-1;n[3]=1; -y.multiply(e,b,k);if(!y.inverse(k))return null;y.multiplyVec4(k,n);if(0===n[3])return null;d[0]=n[0]/n[3];d[1]=n[1]/n[3];d[2]=n[2]/n[3];return d};var z=j.createFrom(1,0,0),A=j.createFrom(0,1,0),H=j.createFrom(0,0,1),C=j.create();j.rotationTo=function(a,b,e){e||(e=s.create());var c=j.dot(a,b);if(1<=c)s.set(O,e);else if(-0.999999>c)j.cross(z,a,C),1E-6>j.length(C)&&j.cross(A,a,C),1E-6>j.length(C)&&j.cross(H,a,C),j.normalize(C),s.fromAngleAxis(Math.PI,C,e);else{var c=Math.sqrt(2*(1+c)),d=1/c;j.cross(a, -b,C);e[0]=C[0]*d;e[1]=C[1]*d;e[2]=C[2]*d;e[3]=0.5*c;s.normalize(e)}1e[3]&&(e[3]=-1);return e};j.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var F={create:function(a){var b=new l(9);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0;return b},createFrom:function(a,b,e,c,d,k,h,E,K){var q=new l(9);q[0]=a;q[1]=b;q[2]=e;q[3]=c;q[4]=d;q[5]=k;q[6]=h;q[7]=E;q[8]=K;return q},determinant:function(a){var b= -a[3],e=a[4],c=a[5],d=a[6],k=a[7],h=a[8];return a[0]*(h*e-c*k)+a[1]*(-h*b+c*d)+a[2]*(k*b-e*d)},inverse:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],E=a[5],K=a[6],q=a[7],f=a[8],g=f*h-E*q,j=-f*k+E*K,J=q*k-h*K,r=e*g+c*j+d*J;if(!r)return null;r=1/r;b||(b=F.create());b[0]=g*r;b[1]=(-f*c+d*q)*r;b[2]=(E*c-d*h)*r;b[3]=j*r;b[4]=(f*e-d*K)*r;b[5]=(-E*e+d*k)*r;b[6]=J*r;b[7]=(-q*e+c*K)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],E=a[4],f=a[5],q=a[6],g= -a[7];a=a[8];var u=b[0],j=b[1],J=b[2],r=b[3],l=b[4],t=b[5],m=b[6],p=b[7];b=b[8];e[0]=u*c+j*h+J*q;e[1]=u*d+j*E+J*g;e[2]=u*k+j*f+J*a;e[3]=r*c+l*h+t*q;e[4]=r*d+l*E+t*g;e[5]=r*k+l*f+t*a;e[6]=m*c+p*h+b*q;e[7]=m*d+p*E+b*g;e[8]=m*k+p*f+b*a;return e},multiplyVec2:function(a,b,e){e||(e=b);var c=b[0];b=b[1];e[0]=c*a[0]+b*a[3]+a[6];e[1]=c*a[1]+b*a[4]+a[7];return e},multiplyVec3:function(a,b,e){e||(e=b);var c=b[0],d=b[1];b=b[2];e[0]=c*a[0]+d*a[3]+b*a[6];e[1]=c*a[1]+d*a[4]+b*a[7];e[2]=c*a[2]+d*a[5]+b*a[8];return e}, -set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])},identity:function(a){a||(a=F.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, -b){if(!b||a===b){var e=a[1],c=a[2],d=a[5];a[1]=a[3];a[2]=a[6];a[3]=e;a[5]=a[7];a[6]=c;a[7]=d;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]=a[8];return b},toMat4:function(a,b){b||(b=y.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ -a[8]+"]"}},y={create:function(a){var b=new l(16);a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]);return b},createFrom:function(a,b,e,c,d,k,h,E,f,q,g,u,j,J,r,m){var t=new l(16);t[0]=a;t[1]=b;t[2]=e;t[3]=c;t[4]=d;t[5]=k;t[6]=h;t[7]=E;t[8]=f;t[9]=q;t[10]=g;t[11]=u;t[12]=j;t[13]=J;t[14]=r;t[15]=m;return t},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4]; -b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])&&1E-6>Math.abs(a[9]-b[9])&&1E-6>Math.abs(a[10]-b[10])&&1E-6>Math.abs(a[11]-b[11])&&1E-6>Math.abs(a[12]- -b[12])&&1E-6>Math.abs(a[13]-b[13])&&1E-6>Math.abs(a[14]-b[14])&&1E-6>Math.abs(a[15]-b[15])},identity:function(a){a||(a=y.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){var e=a[1],c=a[2],d=a[3],k=a[6],h=a[7],E=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=e;a[6]=a[9];a[7]=a[13];a[8]=c;a[9]=k;a[11]=a[14];a[12]=d;a[13]=h;a[14]=E;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12]; -b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b=a[0],e=a[1],c=a[2],d=a[3],k=a[4],h=a[5],E=a[6],f=a[7],g=a[8],I=a[9],u=a[10],j=a[11],l=a[12],r=a[13],m=a[14];a=a[15];return l*I*E*d-g*r*E*d-l*h*u*d+k*r*u*d+g*h*m*d-k*I*m*d-l*I*c*f+g*r*c*f+l*e*u*f-b*r*u*f-g*e*m*f+b*I*m*f+l*h*c*j-k*r*c*j-l*e*E*j+b*r*E*j+k*e*m*j-b*h*m*j-g*h*c*a+k*I*c*a+g*e*E*a-b*I*E*a-k*e*u*a+b*h*u*a},inverse:function(a, -b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],f=a[5],g=a[6],q=a[7],I=a[8],u=a[9],j=a[10],l=a[11],r=a[12],m=a[13],t=a[14],p=a[15],s=e*f-c*h,n=e*g-d*h,v=e*q-k*h,w=c*g-d*f,x=c*q-k*f,y=d*q-k*g,z=I*m-u*r,A=I*t-j*r,C=I*p-l*r,D=u*t-j*m,F=u*p-l*m,H=j*p-l*t,G=s*H-n*F+v*D+w*C-x*A+y*z;if(!G)return null;G=1/G;b[0]=(f*H-g*F+q*D)*G;b[1]=(-c*H+d*F-k*D)*G;b[2]=(m*y-t*x+p*w)*G;b[3]=(-u*y+j*x-l*w)*G;b[4]=(-h*H+g*C-q*A)*G;b[5]=(e*H-d*C+k*A)*G;b[6]=(-r*y+t*v-p*n)*G;b[7]=(I*y-j*v+l*n)*G;b[8]=(h*F-f*C+q*z)*G;b[9]= -(-e*F+c*C-k*z)*G;b[10]=(r*x-m*v+p*s)*G;b[11]=(-I*x+u*v-l*s)*G;b[12]=(-h*D+f*A-g*z)*G;b[13]=(e*D-c*A+d*z)*G;b[14]=(-r*w+m*n-t*s)*G;b[15]=(I*w-u*n+j*s)*G;return b},toRotationMat:function(a,b){b||(b=y.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=F.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10]; -return b},toInverseMat3:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[4],h=a[5],f=a[6],g=a[8],q=a[9],j=a[10],u=j*h-f*q,l=-j*k+f*g,m=q*k-h*g,r=e*u+c*l+d*m;if(!r)return null;r=1/r;b||(b=F.create());b[0]=u*r;b[1]=(-j*c+d*q)*r;b[2]=(f*c-d*h)*r;b[3]=l*r;b[4]=(j*e-d*g)*r;b[5]=(-f*e+d*k)*r;b[6]=m*r;b[7]=(-q*e+c*g)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],f=a[4],g=a[5],q=a[6],j=a[7],u=a[8],l=a[9],m=a[10],r=a[11],p=a[12],t=a[13],s=a[14];a=a[15];var n=b[0], -B=b[1],v=b[2],w=b[3];e[0]=n*c+B*f+v*u+w*p;e[1]=n*d+B*g+v*l+w*t;e[2]=n*k+B*q+v*m+w*s;e[3]=n*h+B*j+v*r+w*a;n=b[4];B=b[5];v=b[6];w=b[7];e[4]=n*c+B*f+v*u+w*p;e[5]=n*d+B*g+v*l+w*t;e[6]=n*k+B*q+v*m+w*s;e[7]=n*h+B*j+v*r+w*a;n=b[8];B=b[9];v=b[10];w=b[11];e[8]=n*c+B*f+v*u+w*p;e[9]=n*d+B*g+v*l+w*t;e[10]=n*k+B*q+v*m+w*s;e[11]=n*h+B*j+v*r+w*a;n=b[12];B=b[13];v=b[14];w=b[15];e[12]=n*c+B*f+v*u+w*p;e[13]=n*d+B*g+v*l+w*t;e[14]=n*k+B*q+v*m+w*s;e[15]=n*h+B*j+v*r+w*a;return e},multiplyVec3:function(a,b,e){e||(e=b); -var c=b[0],d=b[1];b=b[2];e[0]=a[0]*c+a[4]*d+a[8]*b+a[12];e[1]=a[1]*c+a[5]*d+a[9]*b+a[13];e[2]=a[2]*c+a[6]*d+a[10]*b+a[14];return e},multiplyVec4:function(a,b,e){e||(e=b);var c=b[0],d=b[1],k=b[2];b=b[3];e[0]=a[0]*c+a[4]*d+a[8]*k+a[12]*b;e[1]=a[1]*c+a[5]*d+a[9]*k+a[13]*b;e[2]=a[2]*c+a[6]*d+a[10]*k+a[14]*b;e[3]=a[3]*c+a[7]*d+a[11]*k+a[15]*b;return e},translate:function(a,b,e){var c=b[0],d=b[1];b=b[2];var k,h,f,g,q,j,u,l,m,n,p,s;if(!e||a===e)return a[12]=a[0]*c+a[4]*d+a[8]*b+a[12],a[13]=a[1]*c+a[5]*d+ -a[9]*b+a[13],a[14]=a[2]*c+a[6]*d+a[10]*b+a[14],a[15]=a[3]*c+a[7]*d+a[11]*b+a[15],a;k=a[0];h=a[1];f=a[2];g=a[3];q=a[4];j=a[5];u=a[6];l=a[7];m=a[8];n=a[9];p=a[10];s=a[11];e[0]=k;e[1]=h;e[2]=f;e[3]=g;e[4]=q;e[5]=j;e[6]=u;e[7]=l;e[8]=m;e[9]=n;e[10]=p;e[11]=s;e[12]=k*c+q*d+m*b+a[12];e[13]=h*c+j*d+n*b+a[13];e[14]=f*c+u*d+p*b+a[14];e[15]=g*c+l*d+s*b+a[15];return e},scale:function(a,b,e){var c=b[0],d=b[1];b=b[2];if(!e||a===e)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=d,a[5]*=d,a[6]*=d,a[7]*=d,a[8]*=b,a[9]*= -b,a[10]*=b,a[11]*=b,a;e[0]=a[0]*c;e[1]=a[1]*c;e[2]=a[2]*c;e[3]=a[3]*c;e[4]=a[4]*d;e[5]=a[5]*d;e[6]=a[6]*d;e[7]=a[7]*d;e[8]=a[8]*b;e[9]=a[9]*b;e[10]=a[10]*b;e[11]=a[11]*b;e[12]=a[12];e[13]=a[13];e[14]=a[14];e[15]=a[15];return e},rotate:function(a,b,e,c){var d=e[0],k=e[1];e=e[2];var h=Math.sqrt(d*d+k*k+e*e),f,g,q,j,l,m,n,r,p,s,x,y,B,v,w,z,A,C,D,F;if(!h)return null;1!==h&&(h=1/h,d*=h,k*=h,e*=h);f=Math.sin(b);g=Math.cos(b);q=1-g;b=a[0];h=a[1];j=a[2];l=a[3];m=a[4];n=a[5];r=a[6];p=a[7];s=a[8];x=a[9];y= -a[10];B=a[11];v=d*d*q+g;w=k*d*q+e*f;z=e*d*q-k*f;A=d*k*q-e*f;C=k*k*q+g;D=e*k*q+d*f;F=d*e*q+k*f;d=k*e*q-d*f;k=e*e*q+g;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=b*v+m*w+s*z;c[1]=h*v+n*w+x*z;c[2]=j*v+r*w+y*z;c[3]=l*v+p*w+B*z;c[4]=b*A+m*C+s*D;c[5]=h*A+n*C+x*D;c[6]=j*A+r*C+y*D;c[7]=l*A+p*C+B*D;c[8]=b*F+m*d+s*k;c[9]=h*F+n*d+x*k;c[10]=j*F+r*d+y*k;c[11]=l*F+p*d+B*k;return c},rotateX:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[4],k=a[5],h=a[6],f=a[7],g=a[8],q=a[9],j=a[10], -l=a[11];e?a!==e&&(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[4]=d*b+g*c;e[5]=k*b+q*c;e[6]=h*b+j*c;e[7]=f*b+l*c;e[8]=d*-c+g*b;e[9]=k*-c+q*b;e[10]=h*-c+j*b;e[11]=f*-c+l*b;return e},rotateY:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[8],j=a[9],l=a[10],m=a[11];e?a!==e&&(e[4]=a[4],e[5]=a[5],e[6]=a[6],e[7]=a[7],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*-c;e[1]=k*b+j*-c;e[2]=h*b+l*-c;e[3]=f* -b+m*-c;e[8]=d*c+g*b;e[9]=k*c+j*b;e[10]=h*c+l*b;e[11]=f*c+m*b;return e},rotateZ:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[4],j=a[5],l=a[6],m=a[7];e?a!==e&&(e[8]=a[8],e[9]=a[9],e[10]=a[10],e[11]=a[11],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*c;e[1]=k*b+j*c;e[2]=h*b+l*c;e[3]=f*b+m*c;e[4]=d*-c+g*b;e[5]=k*-c+j*b;e[6]=h*-c+l*b;e[7]=f*-c+m*b;return e},frustum:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2*d/f;h[1]=0; -h[2]=0;h[3]=0;h[4]=0;h[5]=2*d/g;h[6]=0;h[7]=0;h[8]=(b+a)/f;h[9]=(c+e)/g;h[10]=-(k+d)/j;h[11]=-1;h[12]=0;h[13]=0;h[14]=-(2*k*d)/j;h[15]=0;return h},perspective:function(a,b,e,c,d){a=e*Math.tan(a*Math.PI/360);b*=a;return y.frustum(-b,b,-a,a,e,c,d)},ortho:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2/f;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/g;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/j;h[11]=0;h[12]=-(a+b)/f;h[13]=-(c+e)/g;h[14]=-(k+d)/j;h[15]=1;return h},lookAt:function(a,b,e,c){c|| -(c=y.create());var d,k,h,f,g,j,l,m,n=a[0],p=a[1];a=a[2];h=e[0];f=e[1];k=e[2];l=b[0];e=b[1];d=b[2];if(n===l&&p===e&&a===d)return y.identity(c);b=n-l;e=p-e;l=a-d;m=1/Math.sqrt(b*b+e*e+l*l);b*=m;e*=m;l*=m;d=f*l-k*e;k=k*b-h*l;h=h*e-f*b;(m=Math.sqrt(d*d+k*k+h*h))?(m=1/m,d*=m,k*=m,h*=m):h=k=d=0;f=e*h-l*k;g=l*d-b*h;j=b*k-e*d;(m=Math.sqrt(f*f+g*g+j*j))?(m=1/m,f*=m,g*=m,j*=m):j=g=f=0;c[0]=d;c[1]=f;c[2]=b;c[3]=0;c[4]=k;c[5]=g;c[6]=e;c[7]=0;c[8]=h;c[9]=j;c[10]=l;c[11]=0;c[12]=-(d*n+k*p+h*a);c[13]=-(f*n+g*p+ -j*a);c[14]=-(b*n+e*p+l*a);c[15]=1;return c},fromRotationTranslation:function(a,b,e){e||(e=y.create());var c=a[0],d=a[1],k=a[2],h=a[3],f=c+c,g=d+d,j=k+k;a=c*f;var l=c*g,c=c*j,m=d*g,d=d*j,k=k*j,f=h*f,g=h*g,h=h*j;e[0]=1-(m+k);e[1]=l+h;e[2]=c-g;e[3]=0;e[4]=l-h;e[5]=1-(a+k);e[6]=d+f;e[7]=0;e[8]=c+g;e[9]=d-f;e[10]=1-(a+m);e[11]=0;e[12]=b[0];e[13]=b[1];e[14]=b[2];e[15]=1;return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ -a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},s={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,e,c){var d=new l(4);d[0]=a;d[1]=b;d[2]=e;d[3]=c;return d},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=s.create()); -a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},O=s.identity();s.calculateW=function(a,b){var e=a[0],c=a[1],d=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d)),a;b[0]=e;b[1]=c;b[2]=d;b[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d));return b};s.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};s.inverse=function(a,b){var e=a[0],c=a[1],d=a[2],f=a[3],e=(e=e*e+c*c+d*d+f*f)?1/e:0;if(!b||a===b)return a[0]*=-e,a[1]*=-e,a[2]*=-e,a[3]*=e,a;b[0]=-a[0]*e;b[1]=-a[1]*e;b[2]=-a[2]*e;b[3]=a[3]*e; -return b};s.conjugate=function(a,b){if(!b||a===b)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};s.length=function(a){var b=a[0],e=a[1],c=a[2];a=a[3];return Math.sqrt(b*b+e*e+c*c+a*a)};s.normalize=function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],f=a[3],h=Math.sqrt(e*e+c*c+d*d+f*f);if(0===h)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;h=1/h;b[0]=e*h;b[1]=c*h;b[2]=d*h;b[3]=f*h;return b};s.add=function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+= -b[3],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];e[3]=a[3]+b[3];return e};s.multiply=function(a,b,e){e||(e=a);var c=a[0],d=a[1],f=a[2];a=a[3];var h=b[0],g=b[1],j=b[2];b=b[3];e[0]=c*b+a*h+d*j-f*g;e[1]=d*b+a*g+f*h-c*j;e[2]=f*b+a*j+c*g-d*h;e[3]=a*b-c*h-d*g-f*j;return e};s.multiplyVec3=function(a,b,e){e||(e=b);var c=b[0],d=b[1],f=b[2];b=a[0];var h=a[1],g=a[2];a=a[3];var j=a*c+h*f-g*d,l=a*d+g*c-b*f,m=a*f+b*d-h*c,c=-b*c-h*d-g*f;e[0]=j*a+c*-b+l*-g-m*-h;e[1]=l*a+c*-h+m*-b-j*-g;e[2]=m*a+c*-g+j*-h-l*-b; -return e};s.scale=function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a[3]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;e[3]=a[3]*b;return e};s.toMat3=function(a,b){b||(b=F.create());var e=a[0],c=a[1],d=a[2],f=a[3],h=e+e,g=c+c,j=d+d,l=e*h,m=e*g,e=e*j,n=c*g,c=c*j,d=d*j,h=f*h,g=f*g,f=f*j;b[0]=1-(n+d);b[1]=m+f;b[2]=e-g;b[3]=m-f;b[4]=1-(l+d);b[5]=c+h;b[6]=e+g;b[7]=c-h;b[8]=1-(l+n);return b};s.toMat4=function(a,b){b||(b=y.create());var e=a[0],c=a[1],d=a[2],f=a[3],g=e+e,j=c+c,l=d+d,m=e*g,n=e*j,e=e* -l,p=c*j,c=c*l,d=d*l,g=f*g,j=f*j,f=f*l;b[0]=1-(p+d);b[1]=n+f;b[2]=e-j;b[3]=0;b[4]=n-f;b[5]=1-(m+d);b[6]=c+g;b[7]=0;b[8]=e+j;b[9]=c-g;b[10]=1-(m+p);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};s.slerp=function(a,b,c,d){d||(d=a);var f=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],g,h;if(1<=Math.abs(f))return d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d;g=Math.acos(f);h=Math.sqrt(1-f*f);if(0.001>Math.abs(h))return d[0]=0.5*a[0]+0.5*b[0],d[1]=0.5*a[1]+0.5*b[1],d[2]=0.5*a[2]+0.5*b[2],d[3]=0.5*a[3]+ -0.5*b[3],d;f=Math.sin((1-c)*g)/h;c=Math.sin(c*g)/h;d[0]=a[0]*f+b[0]*c;d[1]=a[1]*f+b[1]*c;d[2]=a[2]*f+b[2]*c;d[3]=a[3]*f+b[3]*c;return d};s.fromRotationMatrix=function(a,b){b||(b=s.create());var c=a[0]+a[4]+a[8],d;if(0a[0]&&(c=1);a[8]>a[3*c+c]&&(c=2);var f=d[c],g=d[f];d=Math.sqrt(a[3*c+c]-a[3*f+f]-a[3*g+g]+1);b[c]=0.5*d;d= -0.5/d;b[3]=(a[3*g+f]-a[3*f+g])*d;b[f]=(a[3*f+c]+a[3*c+f])*d;b[g]=(a[3*g+c]+a[3*c+g])*d}return b};F.toQuat4=s.fromRotationMatrix;var D=F.create();s.fromAxes=function(a,b,c,d){D[0]=b[0];D[3]=b[1];D[6]=b[2];D[1]=c[0];D[4]=c[1];D[7]=c[2];D[2]=a[0];D[5]=a[1];D[8]=a[2];return s.fromRotationMatrix(D,d)};s.identity=function(a){a||(a=s.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};s.fromAngleAxis=function(a,b,c){c||(c=s.create());a*=0.5;var d=Math.sin(a);c[3]=Math.cos(a);c[0]=d*b[0];c[1]=d*b[1];c[2]=d*b[2]; -return c};s.toAngleAxis=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); -b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 -Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],f=a[2],g=a[3],h=c*g-f*d;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-d*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, -b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];c[0]=d*b[0]+f*b[2];c[1]=d*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=d*b+f*h;c[1]=d*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var d=b[0];b=b[1];c[0]=d*a[0]+b*a[1];c[1]=d*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var d=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=d*b;c[2]=f*h;c[3]= -g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,d){var f=new l(4);f[0]=a;f[1]=b;f[2]=c;f[3]=d;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, -b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| -(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)},squaredLength:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};c&&(c.glMatrixArrayType=l,c.MatrixArray=l,c.setMatrixArrayType=d,c.determineMatrixArrayType= -f,c.glMath=g,c.vec2=M,c.vec3=j,c.vec4=N,c.mat2=L,c.mat3=F,c.mat4=y,c.quat4=s);return{glMatrixArrayType:l,MatrixArray:l,setMatrixArrayType:d,determineMatrixArrayType:f,glMath:g,vec2:M,vec3:j,vec4:N,mat2:L,mat3:F,mat4:y,quat4:s}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * vColor;","}"]; -PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"]; -PIXI.CompileVertexShader=function(c,d){for(var f="",g=0;g 0) { - this.checkVisibility(child); + this.checkVisibility(child, actualVisibility); } + + }; } -/** - * @private - */ -PIXI.WebGLRenderer.prototype.setGLVisible = function(displayObject, visibility) -{ - var children = displayObject.children; - - for (var i=0; i < children.length; i++) - { - var child = children[i]; - - if(visibility) - { - this.addDisplayObject(child); - } - else - { - this.removeDisplayObject(child); - } - - if(child.children.length > 0) - { - this.setGLVisible(child, visibility); - } - } - -} - /** * Renders the stage to its webGL view - * @param the PIXI.Stage element to be rendered + * @method render + * @param stage {Stage} the PIXI.Stage element to be rendered */ PIXI.WebGLRenderer.prototype.render = function(stage) { @@ -185,9 +164,18 @@ // update children if need be // best to remove first! - for (var i=0; i < stage.__childrenRemoved.length; i++) this.removeDisplayObject(stage.__childrenRemoved[i]); + for (var i=0; i < stage.__childrenRemoved.length; i++) + { + this.removeDisplayObject(stage.__childrenRemoved[i]); + // stage.__childrenRemoved[i].cacheVisible = false; + } + /* // no add all new sprites - for (var i=0; i < stage.__childrenAdded.length; i++) this.addDisplayObject(stage.__childrenAdded[i]); + for (var i=0; i < stage.__childrenAdded.length; i++) + { + stage.__childrenAdded[i].cacheVisible = false; +// this.addDisplayObject(stage.__childrenAdded[i]); + }*/ // update any textures for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]); @@ -197,7 +185,7 @@ PIXI.texturesToUpdate = []; // recursivly loop through all items! - this.checkVisibility(stage); + this.checkVisibility(stage, true); // update the scen graph stage.updateTransform(); @@ -206,7 +194,7 @@ gl.clear(gl.COLOR_BUFFER_BIT) - gl.clearColor(1, 1, 1, 1.0); + gl.clearColor(0, 0, 0, 1.0); // set the correct blend mode! gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); @@ -265,12 +253,16 @@ */ PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject) { - if(!displayObject.stage)return; - displayObject.cacheVisible = displayObject.visible; + if(!displayObject.stage)return; // means it was removed + if(displayObject.__inWebGL)return; //means it is already in webgL - if(!displayObject.visible)return; + //displayObject.cacheVisible = displayObject.visible; + + // TODO if objects parent is not visible then dont add to stage!!!! + //if(!displayObject.visible)return; + displayObject.batch = null; //displayObject.cacheVisible = true; @@ -458,10 +450,12 @@ PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject) { //if(displayObject.stage)return; - displayObject.cacheVisible = displayObject.visible; + displayObject.cacheVisible = false;//displayObject.visible; if(!displayObject.renderable)return; + displayObject.__inWebGL = false; + /* * removing is a lot quicker.. * @@ -472,9 +466,11 @@ { // should always have a batch! var batch = displayObject.batch; - if(!batch)return; // thismeans the display list has been altered befre rendering + if(!batch)return; // this means the display list has been altered befre rendering batch.remove(displayObject); + + if(batch.size==0) { batchToRemove = batch @@ -528,8 +524,9 @@ /** * resizes the webGL view to the specified width and height - * @param the new width of the webGL view - * @param the new height of the webGL view + * @method resize + * @param width {Number} the new width of the webGL view + * @param height {Number} the new height of the webGL view */ PIXI.WebGLRenderer.prototype.resize = function(width, height) { diff --git a/src/pixi/renderers/WebGLShaders.js b/src/pixi/renderers/WebGLShaders.js index 8a109dc..b717256 100644 --- a/src/pixi/renderers/WebGLShaders.js +++ b/src/pixi/renderers/WebGLShaders.js @@ -2,7 +2,6 @@ /** * @author Mat Groves http://matgroves.com/ */ -var PIXI = PIXI || {}; PIXI.shaderFragmentSrc = [ "precision mediump float;", "varying vec2 vTextureCoord;", diff --git a/src/pixi/textures/BaseTexture.js b/src/pixi/textures/BaseTexture.js index 0d2221d..a3fdce7 100644 --- a/src/pixi/textures/BaseTexture.js +++ b/src/pixi/textures/BaseTexture.js @@ -1,17 +1,16 @@ /** * @author Mat Groves http://matgroves.com/ */ -var PIXI = PIXI || {}; PIXI.BaseTextureCache = {}; PIXI.texturesToUpdate = []; /** - * @class A texture stores the information that represents an image. All textures have a base texture - * @augments PIXI.EventTarget + * A texture stores the information that represents an image. All textures have a base texture + * @class BaseTexture + * @extends EventTarget * @constructor - * @param image url - * @return A new BaseTexture + * @param imageUrl {String} image url */ PIXI.BaseTexture = function(imageUrl) { @@ -19,13 +18,15 @@ /** * The url of the texture - * @type #BaseTexture + * @property imageUrl + * @type String */ this.imageUrl = imageUrl; /** * The html image that is loaded to create the texture - * @type #BaseTexture + * @property image + * @type Image */ this.image = new Image(); @@ -41,17 +42,19 @@ scope.dispatchEvent( { type: 'loaded', content: scope } ); } - $.proxy(this.onImageLoaded, this); + $.proxy(this.onImageLoaded, this); this.image.src = imageUrl; /** * [read only] The width of the base texture set when the image has loaded - * @type #BaseTexture + * @property width + * @type Number */ this.width = 100; /** * [read only] The height of the base texture set when the image has loaded - * @type #BaseTexture + * @property height + * @type Number */ this.height = 100; diff --git a/src/pixi/textures/Texture.js b/src/pixi/textures/Texture.js index e46fd9f..3f6457a 100644 --- a/src/pixi/textures/Texture.js +++ b/src/pixi/textures/Texture.js @@ -1,18 +1,17 @@ /** * @author Mat Groves http://matgroves.com/ */ -var PIXI = PIXI || {}; PIXI.TextureCache = {}; PIXI.FrameCache = {}; /** - * @class A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used - * @augments PIXI.EventTarget + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used + * @class Texture + * @extends EventTarget * @constructor - * @param {PIXI.textures.BaseTexture} base texture {@link PIXI.textures.BaseTexture} - * @param {PIXI.Rectangle} frame {@link PIXI.Rectangle} - * @return A new Texture. + * @param baseTexture {BaseTexture} + * @param frmae {Rectangle} */ PIXI.Texture = function(baseTexture, frame) { @@ -24,9 +23,12 @@ frame = new PIXI.Rectangle(0,0,1,1); } + this.trim = new PIXI.Point(); + /** * The base texture of this texture - * @type #BaseTexture + * @property baseTexture + * @type BaseTexture */ this.baseTexture = baseTexture; @@ -34,6 +36,7 @@ /** * The frame specifies the region of the base texture that this texture uses + * @property frame * @type #Rectangle */ this.frame = frame; @@ -71,8 +74,8 @@ /** * Specifies the rectangle region of the baseTexture - * @param {PIXI.Rectangle} frame {@link PIXI.Rectangle} - * @return A new Texture. + * @method setFrame + * @param frame {Rectangle} */ PIXI.Texture.prototype.setFrame = function(frame) { @@ -86,8 +89,10 @@ * * Helper function that returns a texture based on an image url * If the image is not in the texture cache it will be created and loaded - * @param The image url of the texture - * @return {PIXI.textures.Texture} texture {@link PIXI.textures.Texture} + * @static + * @method fromImage + * @param imageUrl {String} The image url of the texture + * @return Texture */ PIXI.Texture.fromImage = function(imageUrl) { @@ -108,21 +113,23 @@ * * Helper function that returns a texture based on a frame id * If the frame id is not in the texture cache an error will be thrown - * @param The frame id of the texture - * @return {PIXI.textures.Texture} texture {@link PIXI.textures.Texture} + * @method fromFrameId + * @param frameId {String} The frame id of the texture + * @return Texture */ PIXI.Texture.fromFrameId = function(frameId) { var texture = PIXI.TextureCache[frameId]; - if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this); + if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this); return texture; } /** * * Adds a texture to the textureCache. - * @param {PIXI.textures.Texture} texture {@link PIXI.textures.Texture} - * @param the id that the texture will be stored against. + * @method addTextureToCache + * @param texture {Texture} + * @param id {String} the id that the texture will be stored against. */ PIXI.Texture.addTextureToCache = function(texture, id) { @@ -132,9 +139,10 @@ /** * * Remove a texture from the textureCache. - * @param the id of the texture to be removed + * @method removeTextureFromCache + * @param id {String} the id of the texture to be removed */ -PIXI.Texture.addTextureToCache = function(id) +PIXI.Texture.removeTextureFromCache = function(id) { PIXI.TextureCache[id] = texture; } diff --git a/src/pixi/utils/Detector.js b/src/pixi/utils/Detector.js index 9450e44..b086f12 100644 --- a/src/pixi/utils/Detector.js +++ b/src/pixi/utils/Detector.js @@ -1,14 +1,14 @@ /** * @author Mat Groves http://matgroves.com/ */ -var PIXI = PIXI || {}; /** * This helper function will automatically detect which renderer you should be using. * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer - * @param the width of the renderers view - * @param the height of the renderers view - * @return A new Renderer + * @method autoDetectRenderer + * @static + * @param width {Number} the width of the renderers view + * @param height {Number} the height of the renderers view */ PIXI.autoDetectRenderer = function(width, height) { diff --git a/src/pixi/utils/EventTarget.js b/src/pixi/utils/EventTarget.js index 3edb506..db8507a 100644 --- a/src/pixi/utils/EventTarget.js +++ b/src/pixi/utils/EventTarget.js @@ -2,7 +2,6 @@ * https://github.com/mrdoob/eventtarget.js/ * THankS mr DOob! */ -var PIXI = PIXI || {}; PIXI.EventTarget = function () { diff --git a/README.md b/README.md index d012149..0dd6b82 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,12 @@ ### Current features ### - webGL renderer (with automatic smart batching allowing for REALLY fast performance) -- canvas renderer +- canvas renderer - full scene graph -- super easy to use API (similar to the flash display list API) +- super easy to use API (similar to twhe flash display list API) - support for texture atlas's - asset loader / sprite sheet loader - auto detect which renderer should be used -- handles device context loss ### Coming soon ### @@ -48,8 +47,8 @@ var stage = new PIXI.Stage; - var bunnyTexture = new PIXI.Texture("bunny.png"); - var bunny = new PIXI.Sprite(rabbitTexture); + var bunnyTexture = new PIXI.Texture.fromImage("bunny.png"); + var bunny = new PIXI.Sprite(bunnyTexture); bunny.position.x = 400; bunny.position.y = 300; diff --git a/bin/pixi.js b/bin/pixi.js index df5858d..65add09 100644 --- a/bin/pixi.js +++ b/bin/pixi.js @@ -1,4 +1,4 @@ -window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= @@ -45,7 +45,7 @@ (b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; -PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l - + - + + + + - - - - + + + + + + + + + diff --git a/docs/api.js b/docs/api.js new file mode 100644 index 0000000..ac07693 --- /dev/null +++ b/docs/api.js @@ -0,0 +1,29 @@ +YUI.add("yuidoc-meta", function(Y) { + Y.YUIDoc = { meta: { + "classes": [ + "AssetLoader", + "BaseTexture", + "CanvasRenderer", + "DisplayObject", + "DisplayObjectContainer", + "MovieClip", + "Point", + "Rectangle", + "Sprite", + "SpriteSheetLoader", + "Stage", + "Texture", + "WebGLBatch", + "WebGLRenderer" + ], + "modules": [ + "PIXI" + ], + "allModules": [ + { + "displayName": "PIXI", + "name": "PIXI" + } + ] +} }; +}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png new file mode 100644 index 0000000..759a1cd --- /dev/null +++ b/docs/assets/css/external-small.png Binary files differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png new file mode 100644 index 0000000..609b336 --- /dev/null +++ b/docs/assets/css/logo.png Binary files differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css new file mode 100644 index 0000000..f8f7ee7 --- /dev/null +++ b/docs/assets/css/main.css @@ -0,0 +1,782 @@ +/* +Font sizes for all selectors other than the body are given in percentages, +with 100% equal to 13px. To calculate a font size percentage, multiply the +desired size in pixels by 7.6923076923. + +Here's a quick lookup table: + +10px - 76.923% +11px - 84.615% +12px - 92.308% +13px - 100% +14px - 107.692% +15px - 115.385% +16px - 123.077% +17px - 130.769% +18px - 138.462% +19px - 146.154% +20px - 153.846% +*/ + +html { + background: #fff; + color: #333; + overflow-y: scroll; +} + +body { + font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; + margin: 0; + padding: 0; +} + +/* -- Links ----------------------------------------------------------------- */ +a { + color: #356de4; + text-decoration: none; +} + +.hidden { + display: none; +} + +a:hover { text-decoration: underline; } + +/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from + sight until it's focused. */ +.jump { + position: absolute; + padding: 3px 6px; + left: -99999px; + top: 0; +} + +.jump:focus { left: 40%; } + +/* -- Paragraphs ------------------------------------------------------------ */ +p { margin: 1.3em 0; } +dd p, td p { margin-bottom: 0; } +dd p:first-child, td p:first-child { margin-top: 0; } + +/* -- Headings -------------------------------------------------------------- */ +h1, h2, h3, h4, h5, h6 { + color: #D98527;/*was #f80*/ + font-family: 'Trebuchet MS', sans-serif; + font-weight: bold; + line-height: 1.1; + margin: 1.1em 0 0.5em; +} + +h1 { + font-size: 184.6%; + color: #30418C; + margin: 0.75em 0 0.5em; +} + +h2 { + font-size: 153.846%; + color: #E48A2B; +} + +h3 { font-size: 138.462%; } + +h4 { + border-bottom: 1px solid #DBDFEA; + color: #E48A2B; + font-size: 115.385%; + font-weight: normal; + padding-bottom: 2px; +} + +h5, h6 { font-size: 107.692%; } + +/* -- Code and examples ----------------------------------------------------- */ +code, kbd, pre, samp { + font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + font-size: 92.308%; + line-height: 1.35; +} + +p code, p kbd, p samp { + background: #FCFBFA; + border: 1px solid #EFEEED; + padding: 0 3px; +} + +a code, a kbd, a samp, +pre code, pre kbd, pre samp, +table code, table kbd, table samp, +.intro code, .intro kbd, .intro samp, +.toc code, .toc kbd, .toc samp { + background: none; + border: none; + padding: 0; +} + +pre.code, pre.terminal, pre.cmd { + overflow-x: auto; + *overflow-x: scroll; + padding: 0.3em 0.6em; +} + +pre.code { + background: #FCFBFA; + border: 1px solid #EFEEED; + border-left-width: 5px; +} + +pre.terminal, pre.cmd { + background: #F0EFFC; + border: 1px solid #D0CBFB; + border-left: 5px solid #D0CBFB; +} + +/* Don't reduce the font size of // elements inside
    +   blocks. */
    +pre code, pre kbd, pre samp { font-size: 100%; }
    +
    +/* Used to denote text that shouldn't be selectable, such as line numbers or
    +   shell prompts. Guess which browser this doesn't work in. */
    +.noselect {
    +    -moz-user-select: -moz-none;
    +    -khtml-user-select: none;
    +    -webkit-user-select: none;
    +    -o-user-select: none;
    +    user-select: none;
    +}
    +
    +/* -- Lists ----------------------------------------------------------------- */
    +dd { margin: 0.2em 0 0.7em 1em; }
    +dl { margin: 1em 0; }
    +dt { font-weight: bold; }
    +
    +/* -- Tables ---------------------------------------------------------------- */
    +caption, th { text-align: left; }
    +
    +table {
    +    border-collapse: collapse;
    +    width: 100%;
    +}
    +
    +td, th {
    +    border: 1px solid #fff;
    +    padding: 5px 12px;
    +    vertical-align: top;
    +}
    +
    +td { background: #E6E9F5; }
    +td dl { margin: 0; }
    +td dl dl { margin: 1em 0; }
    +td pre:first-child { margin-top: 0; }
    +
    +th {
    +    background: #D2D7E6;/*#97A0BF*/
    +    border-bottom: none;
    +    border-top: none;
    +    color: #000;/*#FFF1D5*/
    +    font-family: 'Trebuchet MS', sans-serif;
    +    font-weight: bold;
    +    line-height: 1.3;
    +    white-space: nowrap;
    +}
    +
    +
    +/* -- Layout and Content ---------------------------------------------------- */
    +#doc {
    +    margin: auto;
    +    min-width: 1024px;
    +}
    +
    +.content { padding: 0 20px 0 25px; }
    +
    +.sidebar {
    +    padding: 0 15px 0 10px;
    +}
    +#bd {
    +    padding: 7px 0 130px;
    +    position: relative;
    +    width: 99%;
    +}
    +
    +/* -- Table of Contents ----------------------------------------------------- */
    +
    +/* The #toc id refers to the single global table of contents, while the .toc
    +   class refers to generic TOC lists that could be used throughout the page. */
    +
    +.toc code, .toc kbd, .toc samp { font-size: 100%; }
    +.toc li { font-weight: bold; }
    +.toc li li { font-weight: normal; }
    +
    +/* -- Intro and Example Boxes ----------------------------------------------- */
    +/*
    +.intro, .example { margin-bottom: 2em; }
    +.example {
    +    -moz-border-radius: 4px;
    +    -webkit-border-radius: 4px;
    +    border-radius: 4px;
    +    -moz-box-shadow: 0 0 5px #bfbfbf;
    +    -webkit-box-shadow: 0 0 5px #bfbfbf;
    +    box-shadow: 0 0 5px #bfbfbf;
    +    padding: 1em;
    +}
    +.intro {
    +    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    +}
    +*/
    +
    +/* -- Other Styles ---------------------------------------------------------- */
    +
    +/* These are probably YUI-specific, and should be moved out of Selleck's default
    +   theme. */
    +
    +.button {
    +    border: 1px solid #dadada;
    +    -moz-border-radius: 3px;
    +    -webkit-border-radius: 3px;
    +    border-radius: 3px;
    +    color: #444;
    +    display: inline-block;
    +    font-family: Helvetica, Arial, sans-serif;
    +    font-size: 92.308%;
    +    font-weight: bold;
    +    padding: 4px 13px 3px;
    +    -moz-text-shadow: 1px 1px 0 #fff;
    +    -webkit-text-shadow: 1px 1px 0 #fff;
    +    text-shadow: 1px 1px 0 #fff;
    +    white-space: nowrap;
    +
    +    background: #EFEFEF; /* old browsers */
    +    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    +}
    +
    +.button:hover {
    +    border-color: #466899;
    +    color: #fff;
    +    text-decoration: none;
    +    -moz-text-shadow: 1px 1px 0 #222;
    +    -webkit-text-shadow: 1px 1px 0 #222;
    +    text-shadow: 1px 1px 0 #222;
    +
    +    background: #6396D8; /* old browsers */
    +    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    +    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    +}
    +
    +.newwindow { text-align: center; }
    +
    +.header .version em {
    +    display: block;
    +    text-align: right;
    +}
    +
    +
    +#classdocs .item {
    +    border-bottom: 1px solid #466899;
    +    margin: 1em 0;
    +    padding: 1.5em;
    +}
    +
    +#classdocs .item .params p,
    +    #classdocs .item .returns p,{
    +    display: inline;
    +}
    +
    +#classdocs .item em code, #classdocs .item em.comment {
    +    color: green;
    +}
    +
    +#classdocs .item em.comment a {
    +    color: green;
    +    text-decoration: underline;
    +}
    +
    +#classdocs .foundat {
    +    font-size: 11px;
    +    font-style: normal;
    +}
    +
    +.attrs .emits {
    +    margin-left: 2em;
    +    padding: .5em;
    +    border-left: 1px dashed #ccc;
    +}
    +
    +abbr {
    +    border-bottom: 1px dashed #ccc;
    +    font-size: 80%;
    +    cursor: help;
    +}
    +
    +.prettyprint li.L0, 
    +.prettyprint li.L1, 
    +.prettyprint li.L2, 
    +.prettyprint li.L3, 
    +.prettyprint li.L5, 
    +.prettyprint li.L6, 
    +.prettyprint li.L7, 
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +ul li p {
    +    margin-top: 0;
    +}
    +
    +.method .name {
    +    font-size: 110%;
    +}
    +
    +.apidocs .methods .extends .method,
    +.apidocs .properties .extends .property,
    +.apidocs .attrs .extends .attr,
    +.apidocs .events .extends .event {
    +    font-weight: bold;
    +}
    +
    +.apidocs .methods .extends .inherited,
    +.apidocs .properties .extends .inherited,
    +.apidocs .attrs .extends .inherited,
    +.apidocs .events .extends .inherited {
    +    font-weight: normal;
    +}
    +
    +#hd {
    +    background: whiteSmoke;
    +    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    +    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    +    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    +    border-bottom: 1px solid #DFDFDF;
    +    padding: 0 15px 1px 20px;
    +    margin-bottom: 15px;
    +}
    +
    +#hd img {
    +    margin-right: 10px;
    +    vertical-align: middle;
    +}
    +
    +
    +/* -- API Docs CSS ---------------------------------------------------------- */
    +
    +/*
    +This file is organized so that more generic styles are nearer the top, and more
    +specific styles are nearer the bottom of the file. This allows us to take full
    +advantage of the cascade to avoid redundant style rules. Please respect this
    +convention when making changes.
    +*/
    +
    +/* -- Generic TabView styles ------------------------------------------------ */
    +
    +/*
    +These styles apply to all API doc tabviews. To change styles only for a
    +specific tabview, see the other sections below.
    +*/
    +
    +.yui3-js-enabled .apidocs .tabview {
    +    visibility: hidden; /* Hide until the TabView finishes rendering. */
    +    _visibility: visible;
    +}
    +
    +.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    +.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    +
    +/* -- Generic Content Styles ------------------------------------------------ */
    +
    +/* Headings */
    +h2, h3, h4, h5, h6 {
    +    border: none;
    +    color: #30418C;
    +    font-weight: bold;
    +    text-decoration: none;
    +}
    +
    +.link-docs {
    +    float: right;
    +    font-size: 15px;
    +    margin: 4px 4px 6px;
    +    padding: 6px 30px 5px;
    +}
    +
    +.apidocs { zoom: 1; }
    +
    +/* Generic box styles. */
    +.apidocs .box {
    +    border: 1px solid;
    +    border-radius: 3px;
    +    margin: 1em 0;
    +    padding: 0 1em;
    +}
    +
    +/* A flag is a compact, capsule-like indicator of some kind. It's used to
    +   indicate private and protected items, item return types, etc. in an
    +   attractive and unobtrusive way. */
    +.apidocs .flag {
    +    background: #bababa;
    +    border-radius: 3px;
    +    color: #fff;
    +    font-size: 11px;
    +    margin: 0 0.5em;
    +    padding: 2px 4px 1px;
    +}
    +
    +/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    +.apidocs .meta {
    +    background: #f9f9f9;
    +    border-color: #efefef;
    +    color: #555;
    +    font-size: 11px;
    +    padding: 3px 6px;
    +}
    +
    +.apidocs .meta p { margin: 0; }
    +
    +/* Deprecation warning. */
    +.apidocs .box.deprecated,
    +.apidocs .flag.deprecated {
    +    background: #fdac9f;
    +    border: 1px solid #fd7775;
    +}
    +
    +.apidocs .box.deprecated p { margin: 0.5em 0; }
    +.apidocs .flag.deprecated { color: #333; }
    +
    +/* Module/Class intro description. */
    +.apidocs .intro {
    +    background: #f0f1f8;
    +    border-color: #d4d8eb;
    +}
    +
    +/* Loading spinners. */
    +#bd.loading .apidocs,
    +#api-list.loading .yui3-tabview-panel {
    +    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    +    min-height: 150px;
    +}
    +
    +#bd.loading .apidocs .content,
    +#api-list.loading .yui3-tabview-panel .apis {
    +    display: none;
    +}
    +
    +.apidocs .no-visible-items { color: #666; }
    +
    +/* Generic inline list. */
    +.apidocs ul.inline {
    +    display: inline;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +}
    +
    +.apidocs ul.inline li { display: inline; }
    +
    +/* Comma-separated list. */
    +.apidocs ul.commas li:after { content: ','; }
    +.apidocs ul.commas li:last-child:after { content: ''; }
    +
    +/* Keyboard shortcuts. */
    +kbd .cmd { font-family: Monaco, Helvetica; }
    +
    +/* -- Generic Access Level styles ------------------------------------------- */
    +.apidocs .item.protected,
    +.apidocs .item.private,
    +.apidocs .index-item.protected,
    +.apidocs .index-item.deprecated,
    +.apidocs .index-item.private {
    +    display: none;
    +}
    +
    +.show-deprecated .item.deprecated,
    +.show-deprecated .index-item.deprecated,
    +.show-protected .item.protected,
    +.show-protected .index-item.protected,
    +.show-private .item.private,
    +.show-private .index-item.private {
    +    display: block;
    +}
    +
    +.hide-inherited .item.inherited,
    +.hide-inherited .index-item.inherited {
    +    display: none;
    +}
    +
    +/* -- Generic Item Index styles --------------------------------------------- */
    +.apidocs .index { margin: 1.5em 0 3em; }
    +
    +.apidocs .index h3 {
    +    border-bottom: 1px solid #efefef;
    +    color: #333;
    +    font-size: 13px;
    +    margin: 2em 0 0.6em;
    +    padding-bottom: 2px;
    +}
    +
    +.apidocs .index .no-visible-items { margin-top: 2em; }
    +
    +.apidocs .index-list {
    +    border-color: #efefef;
    +    font-size: 12px;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    -moz-column-count: 4;
    +    -moz-column-gap: 10px;
    +    -moz-column-width: 170px;
    +    -ms-column-count: 4;
    +    -ms-column-gap: 10px;
    +    -ms-column-width: 170px;
    +    -o-column-count: 4;
    +    -o-column-gap: 10px;
    +    -o-column-width: 170px;
    +    -webkit-column-count: 4;
    +    -webkit-column-gap: 10px;
    +    -webkit-column-width: 170px;
    +    column-count: 4;
    +    column-gap: 10px;
    +    column-width: 170px;
    +}
    +
    +.apidocs .no-columns .index-list {
    +    -moz-column-count: 1;
    +    -ms-column-count: 1;
    +    -o-column-count: 1;
    +    -webkit-column-count: 1;
    +    column-count: 1;
    +}
    +
    +.apidocs .index-item { white-space: nowrap; }
    +
    +.apidocs .index-item .flag {
    +    background: none;
    +    border: none;
    +    color: #afafaf;
    +    display: inline;
    +    margin: 0 0 0 0.2em;
    +    padding: 0;
    +}
    +
    +/* -- Generic API item styles ----------------------------------------------- */
    +.apidocs .args {
    +    display: inline;
    +    margin: 0 0.5em;
    +}
    +
    +.apidocs .flag.chainable { background: #46ca3b; }
    +.apidocs .flag.protected { background: #9b86fc; }
    +.apidocs .flag.private { background: #fd6b1b; }
    +.apidocs .flag.async { background: #356de4; }
    +.apidocs .flag.required { background: #e60923; }
    +
    +.apidocs .item {
    +    border-bottom: 1px solid #efefef;
    +    margin: 1.5em 0 2em;
    +    padding-bottom: 2em;
    +}
    +
    +.apidocs .item h4,
    +.apidocs .item h5,
    +.apidocs .item h6 {
    +    color: #333;
    +    font-family: inherit;
    +    font-size: 100%;
    +}
    +
    +.apidocs .item .description p,
    +.apidocs .item pre.code {
    +    margin: 1em 0 0;
    +}
    +
    +.apidocs .item .meta {
    +    background: none;
    +    border: none;
    +    padding: 0;
    +}
    +
    +.apidocs .item .name {
    +    display: inline;
    +    font-size: 14px;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .item .type a,
    +.apidocs .returns-inline {
    +    color: #555;
    +}
    +
    +.apidocs .item .type,
    +.apidocs .returns-inline {
    +    font-size: 11px;
    +    margin: 0 0 0 0;
    +}
    +
    +.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    +.apidocs .item .type a:hover { border: none; }
    +
    +/* -- Item Parameter List --------------------------------------------------- */
    +.apidocs .params-list {
    +    list-style: square;
    +    margin: 1em 0 0 2em;
    +    padding: 0;
    +}
    +
    +.apidocs .param { margin-bottom: 1em; }
    +
    +.apidocs .param .type,
    +.apidocs .param .type a {
    +    color: #666;
    +}
    +
    +.apidocs .param .type {
    +    margin: 0 0 0 0.5em;
    +    *margin-left: 0.5em;
    +}
    +
    +.apidocs .param-name { font-weight: bold; }
    +
    +/* -- Item "Emits" block ---------------------------------------------------- */
    +.apidocs .item .emits {
    +    background: #f9f9f9;
    +    border-color: #eaeaea;
    +}
    +
    +/* -- Item "Returns" block -------------------------------------------------- */
    +.apidocs .item .returns .type,
    +.apidocs .item .returns .type a {
    +    font-size: 100%;
    +    margin: 0;
    +}
    +
    +/* -- Class Constructor block ----------------------------------------------- */
    +.apidocs .constructor .item {
    +    border: none;
    +    padding-bottom: 0;
    +}
    +
    +/* -- File Source View ------------------------------------------------------ */
    +.apidocs .file pre.code,
    +#doc .apidocs .file pre.prettyprint {
    +    background: inherit;
    +    border: none;
    +    overflow: visible;
    +    padding: 0;
    +}
    +
    +.apidocs .L0,
    +.apidocs .L1,
    +.apidocs .L2,
    +.apidocs .L3,
    +.apidocs .L4,
    +.apidocs .L5,
    +.apidocs .L6,
    +.apidocs .L7,
    +.apidocs .L8,
    +.apidocs .L9 {
    +    background: inherit;
    +}
    +
    +/* -- Submodule List -------------------------------------------------------- */
    +.apidocs .module-submodule-description {
    +    font-size: 12px;
    +    margin: 0.3em 0 1em;
    +}
    +
    +.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    +
    +/* -- Sidebar TabView ------------------------------------------------------- */
    +#api-tabview { margin-top: 0.6em; }
    +
    +#api-tabview-filter,
    +#api-tabview-panel {
    +    border: 1px solid #dfdfdf;
    +}
    +
    +#api-tabview-filter {
    +    border-bottom: none;
    +    border-top: none;
    +    padding: 0.6em 10px 0 10px;
    +}
    +
    +#api-tabview-panel { border-top: none; }
    +#api-filter { width: 97%; }
    +
    +/* -- Content TabView ------------------------------------------------------- */
    +#classdocs .yui3-tabview-panel { border: none; }
    +
    +/* -- Source File Contents -------------------------------------------------- */
    +.prettyprint li.L0,
    +.prettyprint li.L1,
    +.prettyprint li.L2,
    +.prettyprint li.L3,
    +.prettyprint li.L5,
    +.prettyprint li.L6,
    +.prettyprint li.L7,
    +.prettyprint li.L8 {
    +    list-style: decimal;
    +}
    +
    +/* -- API options ----------------------------------------------------------- */
    +#api-options {
    +    font-size: 11px;
    +    margin-top: 2.2em;
    +    position: absolute;
    +    right: 1.5em;
    +}
    +
    +/*#api-options label { margin-right: 0.6em; }*/
    +
    +/* -- API list -------------------------------------------------------------- */
    +#api-list {
    +    margin-top: 1.5em;
    +    *zoom: 1;
    +}
    +
    +.apis {
    +    font-size: 12px;
    +    line-height: 1.4;
    +    list-style: none;
    +    margin: 0;
    +    padding: 0.5em 0 0.5em 0.4em;
    +}
    +
    +.apis a {
    +    border: 1px solid transparent;
    +    display: block;
    +    margin: 0 0 0 -4px;
    +    padding: 1px 4px 0;
    +    text-decoration: none;
    +    _border: none;
    +    _display: inline;
    +}
    +
    +.apis a:hover,
    +.apis a:focus {
    +    background: #E8EDFC;
    +    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    +    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    +    border-color: #AAC0FA;
    +    border-radius: 3px;
    +    color: #333;
    +    outline: none;
    +}
    +
    +.api-list-item a:hover,
    +.api-list-item a:focus {
    +    font-weight: bold;
    +    text-shadow: 1px 1px 1px #fff;
    +}
    +
    +.apis .message { color: #888; }
    +.apis .result a { padding: 3px 5px 2px; }
    +
    +.apis .result .type {
    +    right: 4px;
    +    top: 7px;
    +}
    +
    +.api-list-item .yui3-highlight {
    +    font-weight: bold;
    +}
    +
    diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png
    new file mode 100644
    index 0000000..5a95dda
    --- /dev/null
    +++ b/docs/assets/favicon.png
    Binary files differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    new file mode 100644
    index 0000000..44f96ba
    --- /dev/null
    +++ b/docs/assets/img/spinner.gif
    Binary files differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    new file mode 100644
    index 0000000..487fe15
    --- /dev/null
    +++ b/docs/assets/index.html
    @@ -0,0 +1,10 @@
    +
    +
    +    
    +        Redirector
    +        
    +    
    +    
    +        Click here to redirect
    +    
    +
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    new file mode 100644
    index 0000000..37aefba
    --- /dev/null
    +++ b/docs/assets/js/api-filter.js
    @@ -0,0 +1,52 @@
    +YUI.add('api-filter', function (Y) {
    +
    +Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    +    // -- Initializer ----------------------------------------------------------
    +    initializer: function () {
    +        this._bindUIACBase();
    +        this._syncUIACBase();
    +    },
    +    getDisplayName: function(name) {
    +
    +        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    +            if (i.name === name && i.displayName) {
    +                name = i.displayName;
    +            }
    +        });
    +
    +        return name;
    +    }
    +
    +}, {
    +    // -- Attributes -----------------------------------------------------------
    +    ATTRS: {
    +        resultHighlighter: {
    +            value: 'phraseMatch'
    +        },
    +
    +        // May be set to "classes" or "modules".
    +        queryType: {
    +            value: 'classes'
    +        },
    +
    +        source: {
    +            valueFn: function() {
    +                var self = this;
    +                return function(q) {
    +                    var data = Y.YUIDoc.meta[self.get('queryType')],
    +                        out = [];
    +                    Y.each(data, function(v) {
    +                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    +                            out.push(v);
    +                        }
    +                    });
    +                    return out;
    +                };
    +            }
    +        }
    +    }
    +});
    +
    +}, '3.4.0', {requires: [
    +    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    +]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    new file mode 100644
    index 0000000..88905b5
    --- /dev/null
    +++ b/docs/assets/js/api-list.js
    @@ -0,0 +1,251 @@
    +YUI.add('api-list', function (Y) {
    +
    +var Lang   = Y.Lang,
    +    YArray = Y.Array,
    +
    +    APIList = Y.namespace('APIList'),
    +
    +    classesNode    = Y.one('#api-classes'),
    +    inputNode      = Y.one('#api-filter'),
    +    modulesNode    = Y.one('#api-modules'),
    +    tabviewNode    = Y.one('#api-tabview'),
    +
    +    tabs = APIList.tabs = {},
    +
    +    filter = APIList.filter = new Y.APIFilter({
    +        inputNode : inputNode,
    +        maxResults: 1000,
    +
    +        on: {
    +            results: onFilterResults
    +        }
    +    }),
    +
    +    search = APIList.search = new Y.APISearch({
    +        inputNode : inputNode,
    +        maxResults: 100,
    +
    +        on: {
    +            clear  : onSearchClear,
    +            results: onSearchResults
    +        }
    +    }),
    +
    +    tabview = APIList.tabview = new Y.TabView({
    +        srcNode  : tabviewNode,
    +        panelNode: '#api-tabview-panel',
    +        render   : true,
    +
    +        on: {
    +            selectionChange: onTabSelectionChange
    +        }
    +    }),
    +
    +    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    +        circular   : true,
    +        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    +        keys       : {next: 'down:40', previous: 'down:38'}
    +    }).focusManager,
    +
    +    LIST_ITEM_TEMPLATE =
    +        '
  • ' + + '{displayName}' + + '
  • '; + +// -- Init --------------------------------------------------------------------- + +// Duckpunch FocusManager's key event handling to prevent it from handling key +// events when a modifier is pressed. +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusPrevious', focusManager); + +Y.before(function (e, activeDescendant) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return new Y.Do.Prevent(); + } +}, focusManager, '_focusNext', focusManager); + +// Create a mapping of tabs in the tabview so we can refer to them easily later. +tabview.each(function (tab, index) { + var name = tab.get('label').toLowerCase(); + + tabs[name] = { + index: index, + name : name, + tab : tab + }; +}); + +// Switch tabs on Ctrl/Cmd-Left/Right arrows. +tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); + +// Focus the filter input when the `/` key is pressed. +Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); + +// Keep the Focus Manager up to date. +inputNode.on('focus', function () { + focusManager.set('activeDescendant', inputNode); +}); + +// Update all tabview links to resolved URLs. +tabview.get('panelNode').all('a').each(function (link) { + link.setAttribute('href', link.get('href')); +}); + +// -- Private Functions -------------------------------------------------------- +function getFilterResultNode() { + return filter.get('queryType') === 'classes' ? classesNode : modulesNode; +} + +// -- Event Handlers ----------------------------------------------------------- +function onFilterResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()), + resultNode = getFilterResultNode(), + typePlural = filter.get('queryType'), + typeSingular = typePlural === 'classes' ? 'class' : 'module'; + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { + rootPath : APIList.rootPath, + displayName : filter.getDisplayName(result.highlighted), + name : result.text, + typePlural : typePlural, + typeSingular: typeSingular + })); + }); + } else { + frag.append( + '
  • ' + + 'No ' + typePlural + ' found.' + + '
  • ' + ); + } + + resultNode.empty(true); + resultNode.append(frag); + + focusManager.refresh(); +} + +function onSearchClear(e) { + + focusManager.refresh(); +} + +function onSearchKey(e) { + var target = e.target; + + if (target.test('input,select,textarea') + || target.get('isContentEditable')) { + return; + } + + e.preventDefault(); + + inputNode.focus(); + focusManager.refresh(); +} + +function onSearchResults(e) { + var frag = Y.one(Y.config.doc.createDocumentFragment()); + + if (e.results.length) { + YArray.each(e.results, function (result) { + frag.append(result.display); + }); + } else { + frag.append( + '
  • ' + + 'No results found. Maybe you\'ll have better luck with a ' + + 'different query?' + + '
  • ' + ); + } + + + focusManager.refresh(); +} + +function onTabSelectionChange(e) { + var tab = e.newVal, + name = tab.get('label').toLowerCase(); + + tabs.selected = { + index: tab.get('index'), + name : name, + tab : tab + }; + + switch (name) { + case 'classes': // fallthru + case 'modules': + filter.setAttrs({ + minQueryLength: 0, + queryType : name + }); + + search.set('minQueryLength', -1); + + // Only send a request if this isn't the initially-selected tab. + if (e.prevVal) { + filter.sendRequest(filter.get('value')); + } + break; + + case 'everything': + filter.set('minQueryLength', -1); + search.set('minQueryLength', 1); + + if (search.get('value')) { + search.sendRequest(search.get('value')); + } else { + inputNode.focus(); + } + break; + + default: + // WTF? We shouldn't be here! + filter.set('minQueryLength', -1); + search.set('minQueryLength', -1); + } + + if (focusManager) { + setTimeout(function () { + focusManager.refresh(); + }, 1); + } +} + +function onTabSwitchKey(e) { + var currentTabIndex = tabs.selected.index; + + if (!(e.ctrlKey || e.metaKey)) { + return; + } + + e.preventDefault(); + + switch (e.keyCode) { + case 37: // left arrow + if (currentTabIndex > 0) { + tabview.selectChild(currentTabIndex - 1); + inputNode.focus(); + } + break; + + case 39: // right arrow + if (currentTabIndex < (Y.Object.size(tabs) - 2)) { + tabview.selectChild(currentTabIndex + 1); + inputNode.focus(); + } + break; + } +} + +}, '3.4.0', {requires: [ + 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' +]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js new file mode 100644 index 0000000..175f6a6 --- /dev/null +++ b/docs/assets/js/api-search.js @@ -0,0 +1,98 @@ +YUI.add('api-search', function (Y) { + +var Lang = Y.Lang, + Node = Y.Node, + YArray = Y.Array; + +Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { + // -- Public Properties ---------------------------------------------------- + RESULT_TEMPLATE: + '
  • ' + + '' + + '

    {name}

    ' + + '{resultType}' + + '
    {description}
    ' + + '{class}' + + '
    ' + + '
  • ', + + // -- Initializer ---------------------------------------------------------- + initializer: function () { + this._bindUIACBase(); + this._syncUIACBase(); + }, + + // -- Protected Methods ---------------------------------------------------- + _apiResultFilter: function (query, results) { + // Filter components out of the results. + return YArray.filter(results, function (result) { + return result.raw.resultType === 'component' ? false : result; + }); + }, + + _apiResultFormatter: function (query, results) { + return YArray.map(results, function (result) { + var raw = Y.merge(result.raw), // create a copy + desc = raw.description || ''; + + // Convert description to text and truncate it if necessary. + desc = Node.create('
    ' + desc + '
    ').get('text'); + + if (desc.length > 65) { + desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; + } else { + desc = Y.Escape.html(desc); + } + + raw['class'] || (raw['class'] = ''); + raw.description = desc; + + // Use the highlighted result name. + raw.name = result.highlighted; + + return Lang.sub(this.RESULT_TEMPLATE, raw); + }, this); + }, + + _apiTextLocator: function (result) { + return result.displayName || result.name; + } +}, { + // -- Attributes ----------------------------------------------------------- + ATTRS: { + resultFormatter: { + valueFn: function () { + return this._apiResultFormatter; + } + }, + + resultFilters: { + valueFn: function () { + return this._apiResultFilter; + } + }, + + resultHighlighter: { + value: 'phraseMatch' + }, + + resultListLocator: { + value: 'data.results' + }, + + resultTextLocator: { + valueFn: function () { + return this._apiTextLocator; + } + }, + + source: { + value: '/api/v1/search?q={query}&count={maxResults}' + } + } +}); + +}, '3.4.0', {requires: [ + 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', + 'escape' +]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js new file mode 100644 index 0000000..c080d16 --- /dev/null +++ b/docs/assets/js/apidocs.js @@ -0,0 +1,365 @@ +YUI().use( + 'yuidoc-meta', + 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', +function (Y) { + +var win = Y.config.win, + localStorage = win.localStorage, + + bdNode = Y.one('#bd'), + + pjax, + defaultRoute, + + classTabView, + selectedTab; + +// Kill pjax functionality unless serving over HTTP. +if (!Y.getLocation().protocol.match(/^https?\:/)) { + Y.Router.html5 = false; +} + +// Create the default route with middleware which enables syntax highlighting +// on the loaded content. +defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { + prettyPrint(); + bdNode.removeClass('loading'); + + next(); +}); + +pjax = new Y.Pjax({ + container : '#docs-main', + contentSelector: '#docs-main > .content', + linkSelector : '#bd a', + titleSelector : '#xhr-title', + + navigateOnHash: true, + root : '/', + routes : [ + // -- / ---------------------------------------------------------------- + { + path : '/(index.html)?', + callbacks: defaultRoute + }, + + // -- /classes/* ------------------------------------------------------- + { + path : '/classes/:class.html*', + callbacks: [defaultRoute, 'handleClasses'] + }, + + // -- /files/* --------------------------------------------------------- + { + path : '/files/*file', + callbacks: [defaultRoute, 'handleFiles'] + }, + + // -- /modules/* ------------------------------------------------------- + { + path : '/modules/:module.html*', + callbacks: defaultRoute + } + ] +}); + +// -- Utility Functions -------------------------------------------------------- + +pjax.checkVisibility = function (tab) { + tab || (tab = selectedTab); + + if (!tab) { return; } + + var panelNode = tab.get('panelNode'), + visibleItems; + + // If no items are visible in the tab panel due to the current visibility + // settings, display a message to that effect. + visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { + if (itemNode.getComputedStyle('display') !== 'none') { + return true; + } + }); + + panelNode.all('.no-visible-items').remove(); + + if (!visibleItems) { + if (Y.one('#index .index-item')) { + panelNode.append( + '
    ' + + '

    ' + + 'Some items are not shown due to the current visibility ' + + 'settings. Use the checkboxes at the upper right of this ' + + 'page to change the visibility settings.' + + '

    ' + + '
    ' + ); + } else { + panelNode.append( + '
    ' + + '

    ' + + 'This class doesn\'t provide any methods, properties, ' + + 'attributes, or events.' + + '

    ' + + '
    ' + ); + } + } + + // Hide index sections without any visible items. + Y.all('.index-section').each(function (section) { + var items = 0, + visibleItems = 0; + + section.all('.index-item').each(function (itemNode) { + items += 1; + + if (itemNode.getComputedStyle('display') !== 'none') { + visibleItems += 1; + } + }); + + section.toggleClass('hidden', !visibleItems); + section.toggleClass('no-columns', visibleItems < 4); + }); +}; + +pjax.initClassTabView = function () { + if (!Y.all('#classdocs .api-class-tab').size()) { + return; + } + + if (classTabView) { + classTabView.destroy(); + selectedTab = null; + } + + classTabView = new Y.TabView({ + srcNode: '#classdocs', + + on: { + selectionChange: pjax.onTabSelectionChange + } + }); + + pjax.updateTabState(); + classTabView.render(); +}; + +pjax.initLineNumbers = function () { + var hash = win.location.hash.substring(1), + container = pjax.get('container'), + hasLines, node; + + // Add ids for each line number in the file source view. + container.all('.linenums>li').each(function (lineNode, index) { + lineNode.set('id', 'l' + (index + 1)); + lineNode.addClass('file-line'); + hasLines = true; + }); + + // Scroll to the desired line. + if (hasLines && /^l\d+$/.test(hash)) { + if ((node = container.getById(hash))) { + win.scroll(0, node.getY()); + } + } +}; + +pjax.initRoot = function () { + var terminators = /^(?:classes|files|modules)$/, + parts = pjax._getPathRoot().split('/'), + root = [], + i, len, part; + + for (i = 0, len = parts.length; i < len; i += 1) { + part = parts[i]; + + if (part.match(terminators)) { + // Makes sure the path will end with a "/". + root.push(''); + break; + } + + root.push(part); + } + + pjax.set('root', root.join('/')); +}; + +pjax.updateTabState = function (src) { + var hash = win.location.hash.substring(1), + defaultTab, node, tab, tabPanel; + + function scrollToNode() { + if (node.hasClass('protected')) { + Y.one('#api-show-protected').set('checked', true); + pjax.updateVisibility(); + } + + if (node.hasClass('private')) { + Y.one('#api-show-private').set('checked', true); + pjax.updateVisibility(); + } + + setTimeout(function () { + // For some reason, unless we re-get the node instance here, + // getY() always returns 0. + var node = Y.one('#classdocs').getById(hash); + win.scrollTo(0, node.getY() - 70); + }, 1); + } + + if (!classTabView) { + return; + } + + if (src === 'hashchange' && !hash) { + defaultTab = 'index'; + } else { + if (localStorage) { + defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || + 'index'; + } else { + defaultTab = 'index'; + } + } + + if (hash && (node = Y.one('#classdocs').getById(hash))) { + if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { + if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } + } + + // Scroll to the desired element if this is a hash URL. + if (node) { + if (classTabView.get('rendered')) { + scrollToNode(); + } else { + classTabView.once('renderedChange', scrollToNode); + } + } + } else { + tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + + if (classTabView.get('rendered')) { + Y.Widget.getByNode(tab).set('selected', 1); + } else { + tab.addClass('yui3-tab-selected'); + } + } +}; + +pjax.updateVisibility = function () { + var container = pjax.get('container'); + + container.toggleClass('hide-inherited', + !Y.one('#api-show-inherited').get('checked')); + + container.toggleClass('show-deprecated', + Y.one('#api-show-deprecated').get('checked')); + + container.toggleClass('show-protected', + Y.one('#api-show-protected').get('checked')); + + container.toggleClass('show-private', + Y.one('#api-show-private').get('checked')); + + pjax.checkVisibility(); +}; + +// -- Route Handlers ----------------------------------------------------------- + +pjax.handleClasses = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initClassTabView(); + } + + next(); +}; + +pjax.handleFiles = function (req, res, next) { + var status = res.ioResponse.status; + + // Handles success and local filesystem XHRs. + if (!status || (status >= 200 && status < 300)) { + pjax.initLineNumbers(); + } + + next(); +}; + +// -- Event Handlers ----------------------------------------------------------- + +pjax.onNavigate = function (e) { + var hash = e.hash, + originTarget = e.originEvent && e.originEvent.target, + tab; + + if (hash) { + tab = originTarget && originTarget.ancestor('.yui3-tab', true); + + if (hash === win.location.hash) { + pjax.updateTabState('hashchange'); + } else if (!tab) { + win.location.hash = hash; + } + + e.preventDefault(); + return; + } + + // Only scroll to the top of the page when the URL doesn't have a hash. + this.set('scrollToTop', !e.url.match(/#.+$/)); + + bdNode.addClass('loading'); +}; + +pjax.onOptionClick = function (e) { + pjax.updateVisibility(); +}; + +pjax.onTabSelectionChange = function (e) { + var tab = e.newVal, + tabId = tab.get('contentBox').getAttribute('href').substring(1); + + selectedTab = tab; + + // If switching from a previous tab (i.e., this is not the default tab), + // replace the history entry with a hash URL that will cause this tab to + // be selected if the user navigates away and then returns using the back + // or forward buttons. + if (e.prevVal && localStorage) { + localStorage.setItem('tab_' + pjax.getPath(), tabId); + } + + pjax.checkVisibility(tab); +}; + +// -- Init --------------------------------------------------------------------- + +pjax.on('navigate', pjax.onNavigate); + +pjax.initRoot(); +pjax.upgrade(); +pjax.initClassTabView(); +pjax.initLineNumbers(); +pjax.updateVisibility(); + +Y.APIList.rootPath = pjax.get('root'); + +Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); + +Y.on('hashchange', function (e) { + pjax.updateTabState('hashchange'); +}, win); + +}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js new file mode 100644 index 0000000..18de864 --- /dev/null +++ b/docs/assets/js/yui-prettify.js @@ -0,0 +1,17 @@ +YUI().use('node', function(Y) { + var code = Y.all('.prettyprint.linenums'); + if (code.size()) { + code.each(function(c) { + var lis = c.all('ol li'), + l = 1; + lis.each(function(n) { + n.prepend(''); + l++; + }); + }); + var h = location.hash; + location.hash = ''; + h = h.replace('LINE_', 'LINENUM_'); + location.hash = h; + } +}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html new file mode 100644 index 0000000..b50b841 --- /dev/null +++ b/docs/assets/vendor/prettify/CHANGES.html @@ -0,0 +1,130 @@ + + + + Change Log + + + README + +

    Known Issues

    +
      +
    • Perl formatting is really crappy. Partly because the author is lazy and + partly because Perl is + hard to parse. +
    • On some browsers, <code> elements with newlines in the text + which use CSS to specify white-space:pre will have the newlines + improperly stripped if the element is not attached to the document at the time + the stripping is done. Also, on IE 6, all newlines will be stripped from + <code> elements because of the way IE6 produces + innerHTML. Workaround: use <pre> for code with + newlines. +
    + +

    Change Log

    +

    29 March 2007

    +
      +
    • Added tests for PHP support + to address + issue 3. +
    • Fixed + bug: prettyPrintOne was not halting. This was not + reachable through the normal entry point. +
    • Fixed + bug: recursing into a script block or PHP tag that was not properly + closed would not silently drop the content. + (test) +
    • Fixed + bug: was eating tabs + (test) +
    • Fixed entity handling so that the caveat +
      +

      Caveats: please properly escape less-thans. x&lt;y + instead of x<y, and use " instead of + &quot; for string delimiters.

      +
      + is no longer applicable. +
    • Added noisefree's C# + patch +
    • Added a distribution that has comments and + whitespace removed to reduce download size from 45.5kB to 12.8kB. +
    +

    4 Jul 2008

    +
      +
    • Added language specific formatters that are triggered by the presence + of a lang-<language-file-extension>
    • +
    • Fixed bug: python handling of '''string''' +
    • Fixed bug: / in regex [charsets] should not end regex +
    +

    5 Jul 2008

    +
      +
    • Defined language extensions for Lisp and Lua +
    +

    14 Jul 2008

    +
      +
    • Language handlers for F#, OCAML, SQL +
    • Support for nocode spans to allow embedding of line + numbers and code annotations which should not be styled or otherwise + affect the tokenization of prettified code. + See the issue 22 + testcase. +
    +

    6 Jan 2009

    +
      +
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • +
    • Added .mxml extension to the markup style handler for + Flex MXML files. See + issue 37. +
    • Added .m extension to the C style handler so that Objective + C source files properly highlight. See + issue 58. +
    • Changed HTML lexer to use the same embedded source mechanism as the + wiki language handler, and changed to use the registered + CSS handler for STYLE element content. +
    +

    21 May 2009

    +
      +
    • Rewrote to improve performance on large files. + See benchmarks.
    • +
    • Fixed bugs with highlighting of Haskell line comments, Lisp + number literals, Lua strings, C preprocessor directives, + newlines in Wiki code on Windows, and newlines in IE6.
    • +
    +

    14 August 2009

    +
      +
    • Fixed prettifying of <code> blocks with embedded newlines. +
    +

    3 October 2009

    +
      +
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. +
    +

    19 July 2010

    +
      +
    • Added support for line numbers. Bug + 22
    • +
    • Added YAML support. Bug + 123
    • +
    • Added VHDL support courtesy Le Poussin.
    • +
    • IE performance improvements. Bug + 102 courtesy jacobly.
    • +
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • +
    • Fixed copy and paste in IE[678]. +
    • Changed output to use &#160; instead of + &nbsp; so that the output works when embedded in XML. + Bug + 108.
    • +
    + + diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/assets/vendor/prettify/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html new file mode 100644 index 0000000..c6fe1a3 --- /dev/null +++ b/docs/assets/vendor/prettify/README.html @@ -0,0 +1,203 @@ + + + + + Javascript code prettifier + + + + + + + + + + Languages : CH +

    Javascript code prettifier

    + +

    Setup

    +
      +
    1. Download a distribution +
    2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
      +<link href="prettify.css" type="text/css" rel="stylesheet" />
      +<script type="text/javascript" src="prettify.js"></script>
      +
    3. Add onload="prettyPrint()" to your + document's body tag. +
    4. Modify the stylesheet to get the coloring you prefer
    5. +
    + +

    Usage

    +

    Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
    The original + Prettier +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    + +
    class Voila {
    +public:
    +  // Voila
    +  static const string VOILA = "Voila";
    +
    +  // will not interfere with embedded tags.
    +}
    +
    + +

    FAQ

    +

    Which languages does it work for?

    +

    The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

    + +

    LISPy languages are supported via an extension: + lang-lisp.js.

    +

    And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

    If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

    + +

    How do I specify which language my code is in?

    +

    You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

    +
    <pre class="prettyprint lang-html">
    +  The lang-* class specifies the language file extensions.
    +  File extensions supported by default include
    +    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    +    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    +    "xhtml", "xml", "xsl".
    +</pre>
    + +

    It doesn't work on <obfuscated code sample>?

    +

    Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

    + +

    Which browsers does it work with?

    +

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

    + +

    What's changed?

    +

    See the change log

    + +

    Why doesn't Prettyprinting of strings work on WordPress?

    +

    Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

    This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

    + +

    How do I put line numbers in my code?

    +

    You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

    For example +

    <pre class="prettyprint linenums:4"
    +>// This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +<pre>
    + produces +
    // This is line 4.
    +foo();
    +bar();
    +baz();
    +boo();
    +far();
    +faz();
    +
    + +

    How do I prevent a portion of markup from being marked as code?

    +

    You can use the nocode class to identify a span of markup + that is not code. +

    <pre class=prettyprint>
    +int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    +  Continuation of comment */
    +int y = bar();
    +</pre>
    +produces +
    +int x = foo();  /* This is a comment  This is not code
    +  Continuation of comment */
    +int y = bar();
    +
    + +

    For a more complete example see the issue22 + testcase.

    + +

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    +

    If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

    + addEventListener('load', prettyPrint, false); +
    + wrap it in a closure like +
    + addEventListener('load', function (event) { prettyPrint() }, false); +
    + so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


    + + + + diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css new file mode 100644 index 0000000..d44b3a2 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js new file mode 100644 index 0000000..4845d05 --- /dev/null +++ b/docs/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html new file mode 100644 index 0000000..a16228e --- /dev/null +++ b/docs/classes/AssetLoader.html @@ -0,0 +1,353 @@ + + + + + AssetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    AssetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId() +When all items have been loaded this class will dispatch a 'loaded' event +As each individual item is loaded this class will dispatch a 'progress' event

    +
    + + +
    +

    Constructor

    +
    +

    AssetLoader

    + + +
    + (
      + +
    • + + assetURLs + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + assetURLs + Array + + + + +
      +

      an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    assetURLs

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/AssetLoader.js:19 + +

    + + + + +
    + +
    +

    The array of asset URLs that are going to be loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html new file mode 100644 index 0000000..1ca1ef8 --- /dev/null +++ b/docs/classes/BaseTexture.html @@ -0,0 +1,504 @@ + + + + + BaseTexture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    BaseTexture Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image. All textures have a base texture

    +
    + + +
    +

    Constructor

    +
    +

    BaseTexture

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      image url

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + +
    +

    Properties

    + + +
    + + + + + +
    + + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:54 + +

    + + + + +
    + +
    +

    [read only] The height of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    +

    image

    + Image + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:26 + +

    + + + + +
    + +
    +

    The html image that is loaded to create the texture

    +
    + + + + + + +
    + + +
    +

    imageUrl

    + String + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:19 + +

    + + + + +
    + +
    +

    The url of the texture

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/BaseTexture.js:48 + +

    + + + + +
    + +
    +

    [read only] The width of the base texture set when the image has loaded

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html new file mode 100644 index 0000000..0bbde26 --- /dev/null +++ b/docs/classes/CanvasRenderer.html @@ -0,0 +1,525 @@ + + + + + CanvasRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    CanvasRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:54 + +

    + + + + + +
    + +
    +

    Renders the stage to its canvas view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    context

    + Canvas 2d Context + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:43 + +

    + + + + +
    + +
    +

    The canvas context that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:21 + +

    + + + + +
    + +
    +

    The height of the canvas view

    +
    + + +

    Default: 600

    + + + + + +
    + + +
    +

    view

    + Canvas + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:31 + +

    + + + + +
    + +
    +

    The canvas element that the everything is drawn to

    +
    + + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/CanvasRenderer.js:14 + +

    + + + + +
    + +
    +

    The width of the canvas view

    +
    + + +

    Default: 800

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html new file mode 100644 index 0000000..19c83bd --- /dev/null +++ b/docs/classes/DisplayObject.html @@ -0,0 +1,756 @@ + + + + + DisplayObject - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObject Class

    +
    + + + + + +
    + Defined in: pixi/DisplayObject.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    this is the base class for all objects that are rendered on the screen.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObject

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    autoDetectRenderer

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/utils/Detector.js:5 + +

    + + + + + +
    + +
    +

    This helper function will automatically detect which renderer you should be using. +WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the width of the renderers view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the height of the renderers view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html new file mode 100644 index 0000000..ef00a78 --- /dev/null +++ b/docs/classes/DisplayObjectContainer.html @@ -0,0 +1,973 @@ + + + + + DisplayObjectContainer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    DisplayObjectContainer Class

    +
    + + + +
    + Extends DisplayObject +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.

    +
    + + +
    +

    Constructor

    +
    +

    DisplayObjectContainer

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:6 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html new file mode 100644 index 0000000..313d7f4 --- /dev/null +++ b/docs/classes/MovieClip.html @@ -0,0 +1,826 @@ + + + + + MovieClip - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    MovieClip Class

    +
    + + + + + +
    + Defined in: pixi/MovieClip.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    +
    + + +
    +

    Constructor

    +
    +

    MovieClip

    + + +
    + (
      + +
    • + + textures + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + textures + Array + + + + +
      +

      an array of {Texture} objects that make up the animation

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    gotoAndPlay

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:79 + +

    + + + + + +
    + +
    +

    Goes to a specific frame and begins playing the MovieClip

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to start at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    gotoAndStop

    + + +
    + (
      + +
    • + + frameNumber + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:66 + +

    + + + + + +
    + +
    +

    Stops the MovieClip and goes to a specific frame

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameNumber + Number + + + + +
      +

      frame index to stop at

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    play

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:57 + +

    + + + + + +
    + +
    +

    Plays the MovieClip

    +
    + + + + + + +
    + + +
    +

    stop

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:48 + +

    + + + + + +
    + +
    +

    Stops the MovieClip

    +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    animationSpeed

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:29 + +

    + + + + +
    + +
    +

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    +
    + + + + + + +
    + + +
    +

    currentFrame

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:22 + +

    + + + + +
    + +
    +

    [read only] The index MovieClips current frame (this may not have to be a whole number)

    +
    + + + + + + +
    + + +
    +

    playing

    + Boolean + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:36 + +

    + + + + +
    + +
    +

    [read only] indicates if the MovieClip is currently playing

    +
    + + + + + + +
    + + +
    +

    textures

    + Array + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/MovieClip.js:15 + +

    + + + + +
    + +
    +

    The array of textures that make up the animation

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Point.html b/docs/classes/Point.html new file mode 100644 index 0000000..194ad54 --- /dev/null +++ b/docs/classes/Point.html @@ -0,0 +1,515 @@ + + + + + Point - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Point Class

    +
    + + + + + +
    + Defined in: pixi/Point.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    +
    + + +
    +

    Constructor

    +
    +

    Point

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the point

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:29 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the point + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:14 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Point.js:21 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html new file mode 100644 index 0000000..23ed7ab --- /dev/null +++ b/docs/classes/Rectangle.html @@ -0,0 +1,663 @@ + + + + + Rectangle - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Rectangle Class

    +
    + + + + + +
    + Defined in: pixi/Rectangle.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    +
    + + +
    +

    Constructor

    +
    +

    Rectangle

    + + +
    + (
      + +
    • + + x + +
    • + +
    • + + y + +
    • + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + x + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + y + Number + + + + +
      +

      position of the rectangle

      +
      + + +
    • + +
    • + + width + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      of the rectangle

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + +
      + +
    • + clone + + + +
    • + +
    +
    + + + +
    +

    Properties

    + +
      + +
    • + height + + + +
    • + +
    • + width + + + +
    • + +
    • + x + + + +
    • + +
    • + y + + + +
    • + +
    +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    clone

    + + + () + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:45 + +

    + + + + + +
    + +
    + +
    + + + + +
    +

    Returns:

    + +
    + + + a copy of the rectangle + +
    +
    + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    height

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:37 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    width

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:30 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    x

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:16 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    +

    y

    + Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Rectangle.js:23 + +

    + + + + +
    + +
    + +
    + + +

    Default: 0

    + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Sprite.html b/docs/classes/Sprite.html new file mode 100644 index 0000000..0d6ca27 --- /dev/null +++ b/docs/classes/Sprite.html @@ -0,0 +1,1579 @@ + + + + + Sprite - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Sprite Class

    +
    + + + + + + + +
    + Defined in: pixi/Sprite.js:10 +
    + + + + + Module: PIXI + + + + +
    + + + +
    + +
    + + +
    +

    Constructor

    +
    +

    Sprite

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:10 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrame

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:111 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId + The frame ids are created when a Texture packer file has been loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame Id of the texture in the cache

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the frameId + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + The + +
    • + +
    ) +
    + + + + + Sprite + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:127 + +

    + + + + + +
    + +
    +

    Helper function that creates a sprite that will contain a texture based on an image url + If the image is not in the texture cache it will be loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + The + Object + + + + +
      +

      image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Sprite: + + A new Sprite using a texture from the texture cache matching the image id + +
    +
    + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    setTexture

    + + +
    + (
      + +
    • + + texture + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:79 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      +

      The PIXI texture that is displayed by the sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    anchor

    + Point + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:21 + +

    + + + + +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + + +
    + + +
    +

    blendMode

    + Uint + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:38 + +

    + + + + +
    + +
    +

    The blend mode of sprite. +currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    height

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:53 + +

    + + + + +
    + +
    +

    The height of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    texture

    + Texture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:31 + +

    + + + + +
    + +
    +

    The texture that the sprite is using

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    +

    width

    + #Number + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Sprite.js:46 + +

    + + + + +
    + +
    +

    The width of the sprite (this is initially set by the texture)

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html new file mode 100644 index 0000000..a04eb38 --- /dev/null +++ b/docs/classes/SpriteSheetLoader.html @@ -0,0 +1,290 @@ + + + + + SpriteSheetLoader - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    SpriteSheetLoader Class

    +
    + + + +
    + Extends EventTarget +
    + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    The sprite sheet loader is used to load in JSON sprite sheet data +To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format +There is a free version so thats nice, although the paid version is great value for money. +It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed. +Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId() +This loader will also load the image file that the Spritesheet points to as well as the data. +When loaded this class will dispatch a 'loaded' event

    +
    + + +
    +

    Constructor

    +
    +

    SpriteSheetLoader

    + + +
    + (
      + +
    • + + url + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/loaders/SpriteSheetLoader.js:5 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + url + String + + + + +
      +

      the url of the sprite sheet JSON file

      +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + + + + + + + +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html new file mode 100644 index 0000000..371f571 --- /dev/null +++ b/docs/classes/Stage.html @@ -0,0 +1,1144 @@ + + + + + Stage - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Stage Class

    +
    + + + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    +
    + + +
    +

    Constructor

    +
    +

    Stage

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:5 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    __addChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:44 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    __removeChild

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:63 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    +

    addChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:29 + +

    + + + + + +
    + +
    +

    Adds a child to the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    addChildAt

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    • + + index + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:51 + +

    + + + + + +
    + +
    +

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + DisplayObject + DisplayObject + + + + +
      + +
      + + +
    • + +
    • + + index + Number + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    removeChild

    + + +
    + (
      + +
    • + + DisplayObject + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:97 + +

    + + + + + +
    + +
    +

    Removes a child from the container.

    +
    + + +
    +

    Parameters:

    + + +
    + + + + + +
    + + +
    +

    updateTransform

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/Stage.js:26 + +

    + + + + + +
    + +
    + +
    + + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    alpha

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:33 + +

    + + + + +
    + +
    +

    The opacity of the object.

    +
    + + + + + + +
    + + +
    +

    children

    + Array + + + + + + + + + +
    + + +

    Inherited from + DisplayObjectContainer: + + + + pixi/DisplayObjectContainer.js:16 + +

    + + + + +
    + +
    +

    [read-only] The of children of this container.

    +
    + + + + + + +
    + + +
    +

    parent

    + DisplayObjectContainer + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:48 + +

    + + + + +
    + +
    +

    [read-only] The display object container that contains this display object.

    +
    + + + + + + +
    + + +
    +

    position

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:12 + +

    + + + + +
    + +
    +

    The coordinate of the object relative to the local coordinates of the parent.

    +
    + + + + + + +
    + + +
    +

    rotation

    + Number + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:26 + +

    + + + + +
    + +
    +

    The rotation of the object in radians.

    +
    + + + + + + +
    + + +
    +

    scale

    + Point + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:19 + +

    + + + + +
    + +
    +

    The scale factor of the object.

    +
    + + + + + + +
    + + +
    +

    stage

    + Stage + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:55 + +

    + + + + +
    + +
    +

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    +
    + + + + + + +
    + + +
    +

    visible

    + Boolean + + + + + + + + + +
    + + +

    Inherited from + DisplayObject: + + + + pixi/DisplayObject.js:40 + +

    + + + + +
    + +
    +

    The visibility of the object.

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html new file mode 100644 index 0000000..0dc539e --- /dev/null +++ b/docs/classes/Texture.html @@ -0,0 +1,966 @@ + + + + + Texture - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    Texture Class

    +
    + + + +
    + Extends EventTarget +
    + + + +
    + Defined in: pixi/textures/Texture.js:8 +
    + + + + + Module: PIXI + + + + +
    + + + +
    +

    A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used

    +
    + + +
    +

    Constructor

    +
    +

    Texture

    + + +
    + (
      + +
    • + + baseTexture + +
    • + +
    • + + frmae + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:8 + +

    + + + + + +
    + +
    + +
    + + +
    +

    Parameters:

    + +
      + +
    • + + baseTexture + BaseTexture + + + + +
      + +
      + + +
    • + +
    • + + frmae + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + +
    + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + +
    +

    Properties

    + + +
    + + + + + +
    + + +
    +

    Methods

    + + +
    +

    addTextureToCache

    + + +
    + (
      + +
    • + + texture + +
    • + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:127 + +

    + + + + + +
    + +
    +

    Adds a texture to the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + texture + Texture + + + + +
      + +
      + + +
    • + +
    • + + id + String + + + + +
      +

      the id that the texture will be stored against.

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    fromFrameId

    + + +
    + (
      + +
    • + + frameId + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:112 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on a frame id + If the frame id is not in the texture cache an error will be thrown

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frameId + String + + + + +
      +

      The frame id of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    fromImage

    + + +
    + (
      + +
    • + + imageUrl + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + static + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:88 + +

    + + + + + +
    + +
    +

    Helper function that returns a texture based on an image url + If the image is not in the texture cache it will be created and loaded

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + imageUrl + String + + + + +
      +

      The image url of the texture

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Texture + +
    +
    + + + +
    + + +
    +

    removeTextureFromCache

    + + +
    + (
      + +
    • + + id + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:139 + +

    + + + + + +
    + +
    +

    Remove a texture from the textureCache.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + id + String + + + + +
      +

      the id of the texture to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    setFrame

    + + +
    + (
      + +
    • + + frame + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:75 + +

    + + + + + +
    + +
    +

    Specifies the rectangle region of the baseTexture

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + frame + Rectangle + + + + +
      + +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + +
    +

    Properties

    + + +
    +

    baseTexture

    + BaseTexture + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:28 + +

    + + + + +
    + +
    +

    The base texture of this texture

    +
    + + + + + + +
    + + +
    +

    frame

    + #Rectangle + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/textures/Texture.js:37 + +

    + + + + +
    + +
    +

    The frame specifies the region of the base texture that this texture uses

    +
    + + + + + + +
    + + +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLBatch.html b/docs/classes/WebGLBatch.html new file mode 100644 index 0000000..c97f357 --- /dev/null +++ b/docs/classes/WebGLBatch.html @@ -0,0 +1,1013 @@ + + + + + WebGLBatch - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLBatch Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    A WebGLBatch Enables a group of sprites to be drawn using the same settings. +if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    init

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:98 + +

    + + + + + +
    + +
    +

    inits the batch's texture and blend mode based if the supplied sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertAfter

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + previousSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:145 + +

    + + + + + +
    + +
    +

    inserts a sprite after the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + previousSprite + Sprite + + + + +
      +

      the first sprite will be inserted after this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    insertBefore

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    • + + nextSprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:117 + +

    + + + + + +
    + +
    +

    inserts a sprite before the specified sprite

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be added

      +
      + + +
    • + +
    • + + nextSprite + NextSprite + + + + +
      +

      the first sprite will be inserted before this sprite

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    merge

    + + +
    + (
      + +
    • + + batch + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:267 + +

    + + + + + +
    + +
    +

    Merges two batchs together

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + batch + WebGLBatch + + + + +
      +

      the batch that will be merged

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    refresh

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:345 + +

    + + + + + +
    + +
    +

    Refresh's all the data in the batch and sync's it with the webGL buffers

    +
    + + + + + + +
    + + +
    +

    remove

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:175 + +

    + + + + + +
    + +
    +

    removes a sprite from the batch

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite to be removed

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    render

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:491 + +

    + + + + + +
    + +
    +

    Draws the batch to the frame buffer

    +
    + + + + + + +
    + + +
    +

    split

    + + +
    + (
      + +
    • + + sprite + +
    • + +
    ) +
    + + + + + WebGLBatch + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:218 + +

    + + + + + +
    + +
    +

    Splits the batch into two with the specified sprite being the start of the new batch.

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + sprite + Sprite + + + + +
      +

      the sprite that indicates where the batch should be split

      +
      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + WebGLBatch: + + the new batch + +
    +
    + + + +
    + + +
    +

    update

    + + + () + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLBatch.js:400 + +

    + + + + + +
    + +
    +

    Updates all the relevant geometry and uploads the data to the GPU

    +
    + + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html new file mode 100644 index 0000000..d4f30a2 --- /dev/null +++ b/docs/classes/WebGLRenderer.html @@ -0,0 +1,416 @@ + + + + + WebGLRenderer - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    WebGLRenderer Class

    +
    + + + + + + + + + + + Module: PIXI + + + + +
    + + + +
    +

    the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's +Dont forget to add the view to your DOM or you will not see anything :)

    +
    + + + +
    + + +
    +
    +

    Item Index

    + + +
    +

    Methods

    + + +
    + + + + + + + +
    + + +
    +

    Methods

    + + +
    +

    render

    + + +
    + (
      + +
    • + + stage + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:156 + +

    + + + + + +
    + +
    +

    Renders the stage to its webGL view

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + stage + Stage + + + + +
      +

      the PIXI.Stage element to be rendered

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    +

    resize

    + + +
    + (
      + +
    • + + width + +
    • + +
    • + + height + +
    • + +
    ) +
    + + + + + + + + + + + + + + + + +
    + + + +

    + + Defined in + + + + + pixi/renderers/WebGLRenderer.js:525 + +

    + + + + + +
    + +
    +

    resizes the webGL view to the specified width and height

    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + width + Number + + + + +
      +

      the new width of the webGL view

      +
      + + +
    • + +
    • + + height + Number + + + + +
      +

      the new height of the webGL view

      +
      + + +
    • + +
    +
    + + + + + +
    + + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/index.html b/docs/classes/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/data.json b/docs/data.json new file mode 100644 index 0000000..0c986fb --- /dev/null +++ b/docs/data.json @@ -0,0 +1,1821 @@ +{ + "project": { + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/" + }, + "files": { + "pixi/extras/Rope.js": { + "name": "pixi/extras/Rope.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/extras/Strip.js": { + "name": "pixi/extras/Strip.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/AssetLoader.js": { + "name": "pixi/loaders/AssetLoader.js", + "modules": {}, + "classes": { + "AssetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/loaders/SpriteSheetLoader.js": { + "name": "pixi/loaders/SpriteSheetLoader.js", + "modules": {}, + "classes": { + "SpriteSheetLoader": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/CanvasRenderer.js": { + "name": "pixi/renderers/CanvasRenderer.js", + "modules": {}, + "classes": { + "CanvasRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLBatch.js": { + "name": "pixi/renderers/WebGLBatch.js", + "modules": {}, + "classes": { + "WebGLBatch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLRenderer.js": { + "name": "pixi/renderers/WebGLRenderer.js", + "modules": {}, + "classes": { + "WebGLRenderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/renderers/WebGLShaders.js": { + "name": "pixi/renderers/WebGLShaders.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/BaseTexture.js": { + "name": "pixi/textures/BaseTexture.js", + "modules": {}, + "classes": { + "BaseTexture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/textures/Texture.js": { + "name": "pixi/textures/Texture.js", + "modules": {}, + "classes": { + "Texture": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Detector.js": { + "name": "pixi/utils/Detector.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/EventTarget.js": { + "name": "pixi/utils/EventTarget.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/utils/Utils.js": { + "name": "pixi/utils/Utils.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObject.js": { + "name": "pixi/DisplayObject.js", + "modules": {}, + "classes": { + "DisplayObject": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/DisplayObjectContainer.js": { + "name": "pixi/DisplayObjectContainer.js", + "modules": {}, + "classes": { + "DisplayObjectContainer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/MovieClip.js": { + "name": "pixi/MovieClip.js", + "modules": {}, + "classes": { + "MovieClip": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Pixi.js": { + "name": "pixi/Pixi.js", + "modules": { + "PIXI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "pixi/Point.js": { + "name": "pixi/Point.js", + "modules": {}, + "classes": { + "Point": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Rectangle.js": { + "name": "pixi/Rectangle.js", + "modules": {}, + "classes": { + "Rectangle": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Sprite.js": { + "name": "pixi/Sprite.js", + "modules": {}, + "classes": { + "Sprite": 1 + }, + "fors": {}, + "namespaces": {} + }, + "pixi/Stage.js": { + "name": "pixi/Stage.js", + "modules": {}, + "classes": { + "Stage": 1 + }, + "fors": {}, + "namespaces": {} + } + }, + "modules": { + "PIXI": { + "name": "PIXI", + "submodules": {}, + "classes": { + "AssetLoader": 1, + "SpriteSheetLoader": 1, + "CanvasRenderer": 1, + "WebGLBatch": 1, + "WebGLRenderer": 1, + "BaseTexture": 1, + "Texture": 1, + "DisplayObject": 1, + "DisplayObjectContainer": 1, + "MovieClip": 1, + "Point": 1, + "Rectangle": 1, + "Sprite": 1, + "Stage": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "pixi/Stage.js", + "line": 5 + } + }, + "classes": { + "AssetLoader": { + "name": "AssetLoader", + "shortname": "AssetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/AssetLoader.js", + "line": 5, + "description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event", + "is_constructor": 1, + "extends": "EventTarget", + "params": [ + { + "name": "assetURLs", + "description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time", + "type": "Array" + } + ] + }, + "SpriteSheetLoader": { + "name": "SpriteSheetLoader", + "shortname": "SpriteSheetLoader", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 5, + "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "url", + "description": "the url of the sprite sheet JSON file", + "type": "String" + } + ] + }, + "CanvasRenderer": { + "name": "CanvasRenderer", + "shortname": "CanvasRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/CanvasRenderer.js", + "line": 5, + "description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ] + }, + "WebGLBatch": { + "name": "WebGLBatch", + "shortname": "WebGLBatch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLBatch.js", + "line": 42, + "description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.", + "params": [ + { + "name": "an", + "description": "instance of the webGL context" + } + ], + "return": { + "description": "WebGLBatch {@link PIXI.renderers.WebGLBatch}", + "type": "PIXI.renderers.WebGLBatch" + } + }, + "WebGLRenderer": { + "name": "WebGLRenderer", + "shortname": "WebGLRenderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/renderers/WebGLRenderer.js", + "line": 7, + "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)", + "params": [ + { + "name": "width", + "description": "the width of the canvas view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the canvas view", + "type": "Number" + } + ], + "default": "0" + }, + "BaseTexture": { + "name": "BaseTexture", + "shortname": "BaseTexture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/BaseTexture.js", + "line": 8, + "description": "A texture stores the information that represents an image. All textures have a base texture", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "imageUrl", + "description": "image url", + "type": "String" + } + ] + }, + "Texture": { + "name": "Texture", + "shortname": "Texture", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/textures/Texture.js", + "line": 8, + "description": "A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used", + "extends": "EventTarget", + "is_constructor": 1, + "params": [ + { + "name": "baseTexture", + "description": "", + "type": "BaseTexture" + }, + { + "name": "frmae", + "description": "", + "type": "Rectangle" + } + ] + }, + "DisplayObject": { + "name": "DisplayObject", + "shortname": "DisplayObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObject.js", + "line": 5, + "description": "this is the base class for all objects that are rendered on the screen.", + "is_constructor": 1 + }, + "DisplayObjectContainer": { + "name": "DisplayObjectContainer", + "shortname": "DisplayObjectContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/DisplayObjectContainer.js", + "line": 6, + "description": "A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.", + "extends": "DisplayObject", + "is_constructor": 1 + }, + "MovieClip": { + "name": "MovieClip", + "shortname": "MovieClip", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "file": "pixi/MovieClip.js", + "line": 5, + "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", + "is_constructor": 1, + "params": [ + { + "name": "textures", + "description": "an array of {Texture} objects that make up the animation", + "type": "Array" + } + ] + }, + "Point": { + "name": "Point", + "shortname": "Point", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Point.js", + "line": 5, + "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the point", + "type": "Number" + }, + { + "name": "y", + "description": "position of the point", + "type": "Number" + } + ] + }, + "Rectangle": { + "name": "Rectangle", + "shortname": "Rectangle", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Rectangle.js", + "line": 5, + "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", + "is_constructor": 1, + "params": [ + { + "name": "x", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "y", + "description": "position of the rectangle", + "type": "Number" + }, + { + "name": "width", + "description": "of the rectangle", + "type": "Number" + }, + { + "name": "height", + "description": "of the rectangle", + "type": "Number" + } + ] + }, + "Sprite": { + "name": "Sprite", + "shortname": "Sprite", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Sprite.js", + "line": 10, + "extends": "DisplayObjectContainer", + "is_constructor": 1, + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + } + ], + "type": "String" + }, + "Stage": { + "name": "Stage", + "shortname": "Stage", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PIXI", + "namespace": "", + "file": "pixi/Stage.js", + "line": 5, + "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", + "extends": "DisplayObjectContainer", + "is_constructor": 1 + } + }, + "classitems": [ + { + "file": "pixi/extras/Rope.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/extras/Strip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 19, + "description": "The array of asset URLs that are going to be loaded", + "itemtype": "property", + "name": "assetURLs", + "type": "Array", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/AssetLoader.js", + "line": 32, + "description": "This will begin loading the assets sequentially", + "class": "AssetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/loaders/SpriteSheetLoader.js", + "line": 36, + "description": "This will begin loading the JSON file", + "class": "SpriteSheetLoader" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 14, + "description": "The width of the canvas view", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "800", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 21, + "description": "The height of the canvas view", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "600", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 31, + "description": "The canvas element that the everything is drawn to", + "itemtype": "property", + "name": "view", + "type": "Canvas", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 43, + "description": "The canvas context that the everything is drawn to", + "itemtype": "property", + "name": "context", + "type": "Canvas 2d Context", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 54, + "description": "Renders the stage to its canvas view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the Stage element to be rendered", + "type": "Stage" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 78, + "description": "resizes the canvas view to the specified width and height", + "params": [ + { + "name": "the", + "description": "new width of the canvas view" + }, + { + "name": "the", + "description": "new height of the canvas view" + } + ], + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 92, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 162, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/CanvasRenderer.js", + "line": 197, + "access": "private", + "tagname": "", + "class": "CanvasRenderer" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 7, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 22, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 31, + "access": "private", + "tagname": "", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 67, + "description": "Cleans the batch so that is can be returned to an object pool and reused", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 98, + "description": "inits the batch's texture and blend mode based if the supplied sprite", + "itemtype": "method", + "name": "init", + "params": [ + { + "name": "sprite", + "description": "the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 117, + "description": "inserts a sprite before the specified sprite", + "itemtype": "method", + "name": "insertBefore", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "nextSprite", + "description": "the first sprite will be inserted before this sprite", + "type": "NextSprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 145, + "description": "inserts a sprite after the specified sprite", + "itemtype": "method", + "name": "insertAfter", + "params": [ + { + "name": "sprite", + "description": "the sprite to be added", + "type": "Sprite" + }, + { + "name": "previousSprite", + "description": "the first sprite will be inserted after this sprite", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 175, + "description": "removes a sprite from the batch", + "itemtype": "method", + "name": "remove", + "params": [ + { + "name": "sprite", + "description": "the sprite to be removed", + "type": "Sprite" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 218, + "description": "Splits the batch into two with the specified sprite being the start of the new batch.", + "itemtype": "method", + "name": "split", + "params": [ + { + "name": "sprite", + "description": "the sprite that indicates where the batch should be split", + "type": "Sprite" + } + ], + "return": { + "description": "the new batch", + "type": "WebGLBatch" + }, + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 267, + "description": "Merges two batchs together", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "batch", + "description": "the batch that will be merged", + "type": "WebGLBatch" + } + ], + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 292, + "description": "Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "methos": "growBatch", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 345, + "description": "Refresh's all the data in the batch and sync's it with the webGL buffers", + "itemtype": "method", + "name": "refresh", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 400, + "description": "Updates all the relevant geometry and uploads the data to the GPU", + "itemtype": "method", + "name": "update", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLBatch.js", + "line": 491, + "description": "Draws the batch to the frame buffer", + "itemtype": "method", + "name": "render", + "class": "WebGLBatch" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 63, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 102, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 156, + "description": "Renders the stage to its webGL view", + "itemtype": "method", + "name": "render", + "params": [ + { + "name": "stage", + "description": "the PIXI.Stage element to be rendered", + "type": "Stage" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 222, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 251, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 447, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 525, + "description": "resizes the webGL view to the specified width and height", + "itemtype": "method", + "name": "resize", + "params": [ + { + "name": "width", + "description": "the new width of the webGL view", + "type": "Number" + }, + { + "name": "height", + "description": "the new height of the webGL view", + "type": "Number" + } + ], + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 546, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 574, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 652, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLRenderer.js", + "line": 661, + "access": "private", + "tagname": "", + "class": "WebGLRenderer" + }, + { + "file": "pixi/renderers/WebGLShaders.js", + "line": 2, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 19, + "description": "The url of the texture", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 26, + "description": "The html image that is loaded to create the texture", + "itemtype": "property", + "name": "image", + "type": "Image", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 48, + "description": "[read only] The width of the base texture set when the image has loaded", + "itemtype": "property", + "name": "width", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/BaseTexture.js", + "line": 54, + "description": "[read only] The height of the base texture set when the image has loaded", + "itemtype": "property", + "name": "height", + "type": "Number", + "class": "BaseTexture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 28, + "description": "The base texture of this texture", + "itemtype": "property", + "name": "baseTexture", + "type": "BaseTexture", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 37, + "description": "The frame specifies the region of the base texture that this texture uses", + "itemtype": "property", + "name": "frame", + "type": "#Rectangle", + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 75, + "description": "Specifies the rectangle region of the baseTexture", + "itemtype": "method", + "name": "setFrame", + "params": [ + { + "name": "frame", + "description": "", + "type": "Rectangle" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 88, + "description": "Helper function that returns a texture based on an image url\n If the image is not in the texture cache it will be created and loaded", + "static": 1, + "itemtype": "method", + "name": "fromImage", + "params": [ + { + "name": "imageUrl", + "description": "The image url of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 112, + "description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown", + "itemtype": "method", + "name": "fromFrameId", + "params": [ + { + "name": "frameId", + "description": "The frame id of the texture", + "type": "String" + } + ], + "return": { + "description": "Texture" + }, + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 127, + "description": "Adds a texture to the textureCache.", + "itemtype": "method", + "name": "addTextureToCache", + "params": [ + { + "name": "texture", + "description": "", + "type": "Texture" + }, + { + "name": "id", + "description": "the id that the texture will be stored against.", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/textures/Texture.js", + "line": 139, + "description": "Remove a texture from the textureCache.", + "itemtype": "method", + "name": "removeTextureFromCache", + "params": [ + { + "name": "id", + "description": "the id of the texture to be removed", + "type": "String" + } + ], + "class": "Texture" + }, + { + "file": "pixi/utils/Detector.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Detector.js", + "line": 5, + "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer", + "itemtype": "method", + "name": "autoDetectRenderer", + "static": 1, + "params": [ + { + "name": "width", + "description": "the width of the renderers view", + "type": "Number" + }, + { + "name": "height", + "description": "the height of the renderers view", + "type": "Number" + } + ], + "class": "DisplayObject" + }, + { + "file": "pixi/utils/EventTarget.js", + "line": 1, + "description": "https://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "class": "DisplayObject" + }, + { + "file": "pixi/utils/Utils.js", + "line": 1, + "description": "Provides requestAnimationFrame in a cross browser way.", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 12, + "description": "The coordinate of the object relative to the local coordinates of the parent.", + "itemtype": "property", + "name": "position", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 19, + "description": "The scale factor of the object.", + "itemtype": "property", + "name": "scale", + "type": "Point", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 26, + "description": "The rotation of the object in radians.", + "itemtype": "property", + "name": "rotation", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 33, + "description": "The opacity of the object.", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 40, + "description": "The visibility of the object.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 48, + "description": "[read-only] The display object container that contains this display object.", + "itemtype": "property", + "name": "parent", + "type": "DisplayObjectContainer", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 55, + "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", + "itemtype": "property", + "name": "stage", + "type": "Stage", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObject.js", + "line": 79, + "access": "private", + "tagname": "", + "class": "DisplayObject" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 16, + "description": "[read-only] The of children of this container.", + "itemtype": "property", + "name": "children", + "type": "Array", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 29, + "description": "Adds a child to the container.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 51, + "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", + "itemtype": "method", + "name": "addChildAt", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + }, + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 97, + "description": "Removes a child from the container.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "DisplayObject", + "description": "", + "type": "DisplayObject" + } + ], + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/DisplayObjectContainer.js", + "line": 126, + "access": "private", + "tagname": "", + "class": "DisplayObjectContainer" + }, + { + "file": "pixi/MovieClip.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 15, + "description": "The array of textures that make up the animation", + "itemtype": "property", + "name": "textures", + "type": "Array", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 22, + "description": "[read only] The index MovieClips current frame (this may not have to be a whole number)", + "itemtype": "property", + "name": "currentFrame", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 29, + "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", + "itemtype": "property", + "name": "animationSpeed", + "type": "Number", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 36, + "description": "[read only] indicates if the MovieClip is currently playing", + "itemtype": "property", + "name": "playing", + "type": "Boolean", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 48, + "description": "Stops the MovieClip", + "itemtype": "method", + "name": "stop", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 57, + "description": "Plays the MovieClip", + "itemtype": "method", + "name": "play", + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 66, + "description": "Stops the MovieClip and goes to a specific frame", + "itemtype": "method", + "name": "gotoAndStop", + "params": [ + { + "name": "frameNumber", + "description": "frame index to stop at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/MovieClip.js", + "line": 79, + "description": "Goes to a specific frame and begins playing the MovieClip", + "itemtype": "method", + "name": "gotoAndPlay", + "params": [ + { + "name": "frameNumber", + "description": "frame index to start at", + "type": "Number" + } + ], + "class": "MovieClip" + }, + { + "file": "pixi/Pixi.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point" + }, + { + "file": "pixi/Point.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 14, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 21, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Point.js", + "line": 29, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the point" + }, + "class": "Point", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 16, + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 23, + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 30, + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 37, + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "0", + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Rectangle.js", + "line": 45, + "itemtype": "method", + "name": "clone", + "return": { + "description": "a copy of the rectangle" + }, + "class": "Rectangle", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 21, + "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left \nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right", + "itemtype": "property", + "name": "anchor", + "type": "Point", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 31, + "description": "The texture that the sprite is using", + "itemtype": "property", + "name": "texture", + "type": "Texture", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 38, + "description": "The blend mode of sprite.\ncurrently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN", + "itemtype": "property", + "name": "blendMode", + "type": "uint", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 46, + "description": "The width of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "width", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 53, + "description": "The height of the sprite (this is initially set by the texture)", + "itemtype": "property", + "name": "height", + "type": "#Number", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 79, + "itemtype": "method", + "name": "setTexture", + "params": [ + { + "name": "texture", + "description": "The PIXI texture that is displayed by the sprite", + "type": "Texture" + } + ], + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 98, + "access": "private", + "tagname": "", + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 111, + "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId\n The frame ids are created when a Texture packer file has been loaded", + "itemtype": "method", + "name": "fromFrame", + "static": 1, + "params": [ + { + "name": "frameId", + "description": "The frame Id of the texture in the cache", + "type": "String" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the frameId", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Sprite.js", + "line": 127, + "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", + "itemtype": "method", + "name": "fromImage", + "static": 1, + "params": [ + { + "name": "The", + "description": "image url of the texture" + } + ], + "return": { + "description": "A new Sprite using a texture from the texture cache matching the image id", + "type": "Sprite" + }, + "class": "Sprite", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 1, + "author": "Mat Groves http://matgroves.com/", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 26, + "itemtype": "method", + "name": "updateTransform", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 44, + "itemtype": "method", + "name": "__addChild", + "class": "Stage", + "module": "PIXI" + }, + { + "file": "pixi/Stage.js", + "line": 63, + "itemtype": "method", + "name": "__removeChild", + "class": "Stage", + "module": "PIXI" + } + ], + "warnings": [ + { + "message": "unknown tag: methos", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Rope.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/extras/Strip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/AssetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the assets sequentially", + "line": " pixi/loaders/AssetLoader.js:32" + }, + { + "message": "Missing item type", + "line": " pixi/loaders/SpriteSheetLoader.js:1" + }, + { + "message": "Missing item type\nThis will begin loading the JSON file", + "line": " pixi/loaders/SpriteSheetLoader.js:36" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:1" + }, + { + "message": "Missing item type\nresizes the canvas view to the specified width and height", + "line": " pixi/renderers/CanvasRenderer.js:78" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:92" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:162" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/CanvasRenderer.js:197" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:7" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:22" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLBatch.js:31" + }, + { + "message": "Missing item type\nCleans the batch so that is can be returned to an object pool and reused", + "line": " pixi/renderers/WebGLBatch.js:67" + }, + { + "message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added", + "line": " pixi/renderers/WebGLBatch.js:292" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:63" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:102" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:222" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:251" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:447" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:546" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:574" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:652" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLRenderer.js:661" + }, + { + "message": "Missing item type", + "line": " pixi/renderers/WebGLShaders.js:2" + }, + { + "message": "Missing item type", + "line": " pixi/textures/BaseTexture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/textures/Texture.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/utils/Detector.js:1" + }, + { + "message": "Missing item type\nhttps://github.com/mrdoob/eventtarget.js/\nTHankS mr DOob!", + "line": " pixi/utils/EventTarget.js:1" + }, + { + "message": "Missing item type\nProvides requestAnimationFrame in a cross browser way.", + "line": " pixi/utils/Utils.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObject.js:79" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/DisplayObjectContainer.js:126" + }, + { + "message": "Missing item type", + "line": " pixi/MovieClip.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Pixi.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Point.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Rectangle.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:1" + }, + { + "message": "Missing item type", + "line": " pixi/Sprite.js:98" + }, + { + "message": "Missing item type", + "line": " pixi/Stage.js:1" + } + ] +} \ No newline at end of file diff --git a/docs/files/index.html b/docs/files/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/docs/files/pixi_DisplayObject.js.html b/docs/files/pixi_DisplayObject.js.html new file mode 100644 index 0000000..5fccb4a --- /dev/null +++ b/docs/files/pixi_DisplayObject.js.html @@ -0,0 +1,241 @@ + + + + + pixi/DisplayObject.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObject.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * this is the base class for all objects that are rendered on the screen.
    + * @class DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObject = function()
    +{
    +	/**
    +	 * The coordinate of the object relative to the local coordinates of the parent.
    +	 * @property position
    +	 * @type Point
    +	 */
    +	this.position = new PIXI.Point();
    +	
    +	/**
    +	 * The scale factor of the object.
    +	 * @property scale
    +	 * @type Point
    +	 */
    +	this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    +	
    +	/**
    +	 * The rotation of the object in radians.
    +	 * @property rotation
    +	 * @type Number
    +	 */
    +	this.rotation = 0;
    +	
    +	/**
    +	 * The opacity of the object.
    +	 * @property alpha
    +	 * @type Number
    +	 */	
    +	this.alpha = 1;
    +	
    +	/**
    +	 * The visibility of the object.
    +	 * @property visible
    +	 * @type Boolean
    +	 */	
    +	this.visible = true;
    +	this.cacheVisible = false;
    +	
    +	/**
    +	 * [read-only] The display object container that contains this display object.
    +	 * @property parent
    +	 * @type DisplayObjectContainer
    +	 */	
    +	this.parent = null;
    +	
    +	/**
    +	 * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    +	 * @property stage
    +	 * @type Stage
    +	 */	
    +	this.stage = null;
    +	
    +	this.worldAlpha = 1;
    +	this.color = [];
    +	
    +	this.worldTransform = mat3.identity();
    +	this.localTransform = mat3.identity();
    +	
    +	this.dynamic = true;
    +	// chach that puppy!
    +	this._sr = 0;
    +	this._cr = 1;
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObject.constructor = PIXI.DisplayObject;
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObject.prototype.updateTransform = function()
    +{
    +	// TODO OPTIMIZE THIS!! with dirty
    +	if(this.rotation != this.rotationCache)
    +	{
    +		this.rotationCach = this.rotation;
    +		this._sr =  Math.sin(this.rotation);
    +		this._cr =  Math.cos(this.rotation);
    +	}	
    +		
    +	this.localTransform[0] = this._cr * this.scale.x;
    +	this.localTransform[1] = -this._sr * this.scale.y
    +	this.localTransform[3] = this._sr * this.scale.x;
    +	this.localTransform[4] = this._cr * this.scale.y;
    +	
    +		///AAARR GETTER SETTTER!
    +	
    +	this.localTransform[2] = this.position.x;
    +	this.localTransform[5] = this.position.y;
    +	
    +
    +	// TODO optimize?
    +	mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
    +	this.worldAlpha = this.alpha * this.parent.worldAlpha;		
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_DisplayObjectContainer.js.html b/docs/files/pixi_DisplayObjectContainer.js.html new file mode 100644 index 0000000..7c8f08e --- /dev/null +++ b/docs/files/pixi_DisplayObjectContainer.js.html @@ -0,0 +1,275 @@ + + + + + pixi/DisplayObjectContainer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/DisplayObjectContainer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +/**
    + * A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.
    + * @class DisplayObjectContainer 
    + * @extends DisplayObject
    + * @constructor
    + */
    +PIXI.DisplayObjectContainer = function()
    +{
    +	PIXI.DisplayObject.call( this );
    +	
    +	/**
    +	 * [read-only] The of children of this container.
    +	 * @property children {Array}
    +	 */	
    +	this.children = [];
    +	
    +	this.renderable = false;
    +}
    +
    +// constructor
    +PIXI.DisplayObjectContainer.constructor = PIXI.DisplayObjectContainer;
    +PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    +
    +/**
    + * Adds a child to the container.
    + * @method addChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    +{
    +	if(child.parent != undefined)
    +	{
    +		child.parent.removeChild(child)
    +	}
    +	
    +	child.parent = this;
    +	child.childIndex = this.children.length;
    +	
    +	this.children.push(child);	
    +	if(this.stage)
    +	{
    +		this.stage.__addChild(child);
    +	}
    +}
    +
    +/**
    + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    + * @method addChildAt
    + * @param DisplayObject {DisplayObject}
    + * @param index {Number}
    + */
    +PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    +{
    +	if(index >= 0 && index <= this.children.length)
    +	{
    +		if(child.parent != undefined)
    +		{
    +			child.parent.removeChild(child);
    +		}
    +	
    +		if (index == this.children.length)
    +		{
    +		  	this.children.push(child);
    +		}	
    +		else 
    +		{
    +			this.children.splice(index, 0, child);
    +		}
    +
    +		child.parent = this;
    +		child.childIndex = index;
    +		
    +		var length = this.children.length;
    +		for (var i=index; i < length; i++) 
    +		{
    +		  this.children[i].childIndex = i;
    +		}
    +		
    +		if(this.stage)
    +		{
    +			this.stage.__addChild(child);
    +		}
    +	}
    +	else
    +	{
    +		// error!
    +		
    +		throw new Error(child + " The index "+ index +" supplied is out of bounds " + this.children.length);
    +	}
    +}
    +
    +/**
    + * Removes a child from the container.
    + * @method removeChild
    + * @param  DisplayObject {DisplayObject}
    + */
    +PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    +{
    +	var index = this.children.indexOf( child );
    +
    +	if ( index !== -1 ) 
    +	{
    +		if(this.stage)this.stage.__removeChild(child);
    +		child.parent = undefined;
    +		//child.childIndex = 0
    +		this.children.splice( index, 1 );
    +	
    +		// update in dexs!
    +		for(var i=index,j=this.children.length; i<j; i++)
    +		{
    +			this.children[i].childIndex -= 1;
    +		}
    +	}
    +	else
    +	{
    +		throw new Error(child + " The supplied DisplayObject must be a child of the caller " + this);
    +	}
    +}
    +
    +
    +/**
    + * @private
    + */
    +PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    +{
    +	if(!this.visible)return;
    +	
    +	PIXI.DisplayObject.prototype.updateTransform.call( this );
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_MovieClip.js.html b/docs/files/pixi_MovieClip.js.html new file mode 100644 index 0000000..f8e5d34 --- /dev/null +++ b/docs/files/pixi_MovieClip.js.html @@ -0,0 +1,234 @@ + + + + + pixi/MovieClip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/MovieClip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A MovieClip is a simple way to display an animation depicted by a list of textures.
    + * @class MovieClip
    + * @constructor
    + * @param textures {Array} an array of {Texture} objects that make up the animation
    + */
    +PIXI.MovieClip = function(textures)
    +{
    +	PIXI.Sprite.call( this, textures[0]);
    +	
    +	/**
    +	 * The array of textures that make up the animation
    +	 * @property textures
    +	 * @type Array
    +	 */
    +	this.textures = textures;
    +	
    +	/**
    +	 * [read only] The index MovieClips current frame (this may not have to be a whole number)
    +	 * @property currentFrame
    +	 * @type Number
    +	 */
    +	this.currentFrame = 0; 
    +	
    +	/**
    +	 * The speed that the MovieClip will play at. Higher is faster, lower is slower
    +	 * @property animationSpeed
    +	 * @type Number
    +	 */
    +	this.animationSpeed = 1;
    +	
    +	/**
    +	 * [read only] indicates if the MovieClip is currently playing
    +	 * @property playing
    +	 * @type Boolean
    +	 */
    +	this.playing;
    +}
    +
    +// constructor
    +PIXI.MovieClip.constructor = PIXI.MovieClip;
    +PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    +
    +/**
    + * Stops the MovieClip
    + * @method stop
    + */
    +PIXI.MovieClip.prototype.stop = function()
    +{
    +	this.playing = false;
    +}
    +
    +/**
    + * Plays the MovieClip
    + * @method play
    + */
    +PIXI.MovieClip.prototype.play = function()
    +{
    +	this.playing = true;
    +}
    +
    +/**
    + * Stops the MovieClip and goes to a specific frame
    + * @method gotoAndStop
    + * @param frameNumber {Number} frame index to stop at
    + */
    +PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    +{
    +	this.playing = false;
    +	this.currentFrame = frameNumber;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +
    +/**
    + * Goes to a specific frame and begins playing the MovieClip
    + * @method gotoAndPlay
    + * @param frameNumber {Number} frame index to start at
    + */
    +PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    +{
    +	this.currentFrame = frameNumber;
    +	this.playing = true;
    +}
    +
    +PIXI.MovieClip.prototype.updateTransform = function()
    +{
    +	PIXI.Sprite.prototype.updateTransform.call(this);
    +	
    +	if(!this.playing)return;
    +	
    +	this.currentFrame += this.animationSpeed;
    +	var round = (this.currentFrame + 0.5) | 0;
    +	this.setTexture(this.textures[round % this.textures.length]);
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Pixi.js.html b/docs/files/pixi_Pixi.js.html new file mode 100644 index 0000000..1066836 --- /dev/null +++ b/docs/files/pixi_Pixi.js.html @@ -0,0 +1,144 @@ + + + + + pixi/Pixi.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Pixi.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +@module PIXI
    + */
    +var PIXI = PIXI || {};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Point.js.html b/docs/files/pixi_Point.js.html new file mode 100644 index 0000000..a0a29b6 --- /dev/null +++ b/docs/files/pixi_Point.js.html @@ -0,0 +1,176 @@ + + + + + pixi/Point.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Point.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    + * @class Point
    + * @constructor 
    + * @param x {Number} position of the point
    + * @param y {Number} position of the point
    + */
    +PIXI.Point = function(x, y)
    +{
    +	/**
    +	 * @property x 
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the point
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Point(this.x, this.y);
    +}
    +
    +// constructor
    +PIXI.Point.constructor = PIXI.Point;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Rectangle.js.html b/docs/files/pixi_Rectangle.js.html new file mode 100644 index 0000000..b0410f1 --- /dev/null +++ b/docs/files/pixi_Rectangle.js.html @@ -0,0 +1,192 @@ + + + + + pixi/Rectangle.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Rectangle.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    + * @class Rectangle
    + * @constructor 
    + * @param x {Number} position of the rectangle
    + * @param y {Number} position of the rectangle
    + * @param width {Number} of the rectangle
    + * @param height {Number} of the rectangle
    + */
    +PIXI.Rectangle = function(x, y, width, height)
    +{
    +	/**
    +	 * @property x
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.x = x ? x : 0;
    +	
    +	/**
    +	 * @property y
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.y = y ? y : 0;
    +	
    +	/**
    +	 * @property width
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.width = width ? width : 0;
    +	
    +	/**
    +	 * @property height
    +	 * @type Number
    +	 * @default 0
    +	 */
    +	this.height = height ? height : 0;
    +}
    +
    +/** 
    + * @method clone
    + * @return a copy of the rectangle
    + */
    +PIXI.Point.clone = function()
    +{
    +	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    +}
    +
    +// constructor
    +PIXI.Rectangle.constructor = PIXI.Rectangle;
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Sprite.js.html b/docs/files/pixi_Sprite.js.html new file mode 100644 index 0000000..6b559dd --- /dev/null +++ b/docs/files/pixi_Sprite.js.html @@ -0,0 +1,277 @@ + + + + + pixi/Sprite.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Sprite.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.blendModes = {};
    +PIXI.blendModes.NORMAL = 0;
    +PIXI.blendModes.SCREEN = 1;
    +
    +
    +/**
    +@class Sprite
    +@extends DisplayObjectContainer
    +@constructor
    +@param texture {Texture}
    +@type String
    +*/
    +PIXI.Sprite = function(texture)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	
    +	 /**
    +	 * The anchor sets the origin point of the texture.
    +	 * The default is 0,0 this means the textures origin is the top left 
    +	 * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +	 * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +     * @property anchor
    +     * @type Point
    +     */
    +	this.anchor = new PIXI.Point();
    +	
    +	/**
    +	 * The texture that the sprite is using
    +	 * @property texture
    +	 * @type Texture
    +	 */
    +	this.texture = texture;
    +	
    +	/**
    +	 * The blend mode of sprite.
    +	 * currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN
    +	 * @property blendMode
    +	 * @type uint
    +	 */
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	/**
    +	 * The width of the sprite (this is initially set by the texture)
    +	 * @property width
    +	 * @type #Number
    +	 */
    +	this.width = 1;
    +	
    +	/**
    +	 * The height of the sprite (this is initially set by the texture)
    +	 * @property height
    +	 * @type #Number
    +	 */
    +	this.height = 1;
    +	
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Sprite.constructor = PIXI.Sprite;
    +PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method setTexture
    +@param texture {Texture} The PIXI texture that is displayed by the sprite
    +*/
    +PIXI.Sprite.prototype.setTexture = function(texture)
    +{
    +	// stop current texture;
    +	if(this.texture.baseTexture != texture.baseTexture)
    +	{
    +		this.textureChange = true;	
    +	}
    +	
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.Sprite.prototype.onTextureUpdate = function(event)
    +{
    +	this.width   = this.texture.frame.width;
    +	this.height  = this.texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +// some helper functions..
    +
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
    + * The frame ids are created when a Texture packer file has been loaded
    + * @method fromFrame
    + * @static
    + * @param frameId {String} The frame Id of the texture in the cache
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    + */
    +PIXI.Sprite.fromFrame = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +/**
    + * 
    + * Helper function that creates a sprite that will contain a texture based on an image url
    + * If the image is not in the texture cache it will be loaded
    + * @method fromImage
    + * @static
    + * @param The image url of the texture
    + * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    + */
    +PIXI.Sprite.fromImage = function(imageId)
    +{
    +	var texture = PIXI.Texture.fromImage(imageId);
    +	return new PIXI.Sprite(texture);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_Stage.js.html b/docs/files/pixi_Stage.js.html new file mode 100644 index 0000000..167fa76 --- /dev/null +++ b/docs/files/pixi_Stage.js.html @@ -0,0 +1,215 @@ + + + + + pixi/Stage.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/Stage.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    +A Stage represents the root of the display tree. Everything connected to the stage is rendered
    +@class Stage
    +@extends DisplayObjectContainer
    +@constructor
    +*/
    +PIXI.Stage = function()
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.worldTransform = mat3.identity();
    +	this.__childrenAdded = [];
    +	this.__childrenRemoved = [];
    +	this.childIndex = 0;
    +	this.stage=  this;
    +}
    +
    +// constructor
    +PIXI.Stage.constructor = PIXI.Stage;
    +
    +PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +/**
    +@method updateTransform
    +*/
    +PIXI.Stage.prototype.updateTransform = function()
    +{
    +	this.worldAlpha = 1;		
    +
    +	for(var i=0,j=this.children.length; i<j; i++)
    +	{
    +		this.children[i].updateTransform();	
    +	}
    +}
    +/*
    +PIXI.Stage.prototype.setFilter = function(filters)
    +{
    +	this.filters = filters;
    +}*/
    +
    +/**
    +@method __addChild
    +*/
    +PIXI.Stage.prototype.__addChild = function(child)
    +{
    +	//this.__childrenAdded.push(child);
    +
    +	child.stage = this;
    +	
    +	if(child.children)
    +	{
    +		for (var i=0; i < child.children.length; i++) 
    +		{
    +		  	this.__addChild(child.children[i]);
    +		};
    +	}
    +	
    +}
    +
    +/**
    +@method __removeChild
    +*/
    +PIXI.Stage.prototype.__removeChild = function(child)
    +{
    +	this.__childrenRemoved.push(child);
    +
    +	child.stage = undefined;
    +	
    +	if(child.children)
    +	{
    +		for(var i=0,j=child.children.length; i<j; i++)
    +		{
    +		  	this.__removeChild(child.children[i])
    +		}
    +	}
    +}
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Rope.js.html b/docs/files/pixi_extras_Rope.js.html new file mode 100644 index 0000000..4e05fd4 --- /dev/null +++ b/docs/files/pixi_extras_Rope.js.html @@ -0,0 +1,311 @@ + + + + + pixi/extras/Rope.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Rope.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +
    +PIXI.Rope = function(texture, points)
    +{
    +	PIXI.Strip.call( this, texture );
    +	this.points = points;
    +	
    +	try
    +	{
    +		this.verticies = new Float32Array( points.length * 4);
    +		this.uvs = new Float32Array( points.length * 4);
    +		this.colors = new Float32Array(  points.length * 2);
    +		this.indices = new Uint16Array( points.length * 2);
    +	}
    +	catch(error)
    +	{
    +		this.verticies = verticies
    +		
    +		this.uvs = uvs
    +		this.colors = colors
    +		this.indices = indices
    +	}
    +	
    +	this.refresh();
    +}
    +
    +
    +// constructor
    +PIXI.Rope.constructor = PIXI.Rope;
    +PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    +
    +PIXI.Rope.prototype.refresh = function()
    +{
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var uvs = this.uvs
    +	var indices = this.indices;
    +	var colors = this.colors;
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	
    +	uvs[0] = 0
    +	uvs[1] = 1
    +	uvs[2] = 0
    +	uvs[3] = 1
    +	
    +	colors[0] = 1;
    +	colors[1] = 1;
    +	
    +	indices[0] = 0;
    +	indices[1] = 1;
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		// time to do some smart drawing!
    +		var amount = i/(total-1)
    +		
    +		if(i%2)
    +		{
    +			uvs[index] = amount;
    +			uvs[index+1] = 0;
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		
    +		}
    +		else
    +		{
    +			uvs[index] = amount
    +			uvs[index+1] = 0
    +			
    +			uvs[index+2] = amount
    +			uvs[index+3] = 1
    +		}
    +		
    +		index = i * 2;
    +		colors[index] = 1;
    +		colors[index+1] = 1;
    +		
    +		index = i * 2;
    +		indices[index] = index;
    +		indices[index + 1] = index + 1;
    +		
    +		lastPoint = point;
    +	}
    +}
    +
    +PIXI.Rope.prototype.updateTransform = function()
    +{
    +	
    +	var points = this.points;
    +	if(points.length < 1)return;
    +	
    +	var verticies = this.verticies 
    +	
    +	var lastPoint = points[0];
    +	var nextPoint;
    +	var perp = {x:0, y:0};
    +	var point = points[0];
    +	
    +	this.count-=0.2;
    +	
    +	verticies[0] = point.x + perp.x 
    +	verticies[1] = point.y + perp.y //+ 200
    +	verticies[2] = point.x - perp.x 
    +	verticies[3] = point.y - perp.y//+200
    +	// time to do some smart drawing!
    +	
    +	var total = points.length;
    +		
    +	for (var i =  1; i < total; i++) 
    +	{
    +		
    +		var point = points[i];
    +		var index = i * 4;
    +		
    +		if(i < points.length-1)
    +		{
    +			nextPoint = points[i+1];
    +		}
    +		else
    +		{
    +			nextPoint = point
    +		}
    +		
    +		perp.y = -(nextPoint.x - lastPoint.x);
    +		perp.x = nextPoint.y - lastPoint.y;
    +		
    +		var ratio = (1 - (i / (total-1))) * 10;
    +				if(ratio > 1)ratio = 1;
    +				
    +		var perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    +		var num = this.texture.height/2//(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    +		perp.x /= perpLength;
    +		perp.y /= perpLength;
    +	
    +		perp.x *= num;
    +		perp.y *= num;
    +		
    +		verticies[index] = point.x + perp.x 
    +		verticies[index+1] = point.y + perp.y
    +		verticies[index+2] = point.x - perp.x 
    +		verticies[index+3] = point.y - perp.y
    +
    +		lastPoint = point;
    +	}
    +	
    +	PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    +}
    +
    +PIXI.Rope.prototype.setTexture = function(texture)
    +{
    +	// stop current texture 
    +	this.texture = texture;
    +	this.updateFrame = true;
    +}
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_extras_Strip.js.html b/docs/files/pixi_extras_Strip.js.html new file mode 100644 index 0000000..1a9c9c9 --- /dev/null +++ b/docs/files/pixi_extras_Strip.js.html @@ -0,0 +1,225 @@ + + + + + pixi/extras/Strip.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/extras/Strip.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.Strip = function(texture, width, height)
    +{
    +	PIXI.DisplayObjectContainer.call( this );
    +	this.texture = texture;
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	
    +	try
    +	{
    +		this.uvs = new Float32Array([0, 1,
    +				1, 1,
    +				1, 0, 0,1]);
    +	
    +		this.verticies = new Float32Array([0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0]);
    +						  
    +		this.colors = new Float32Array([1, 1, 1, 1]);
    +		
    +		this.indices = new Uint16Array([0, 1, 2, 3]);
    +	}
    +	catch(error)
    +	{
    +		this.uvs = [0, 1,
    +				1, 1,
    +				1, 0, 0,1];
    +	
    +		this.verticies = [0, 0,
    +						  0,0,
    +						  0,0, 0,
    +						  0, 0];
    +						  
    +		this.colors = [1, 1, 1, 1];
    +		
    +		this.indices = [0, 1, 2, 3];
    +	}
    +	
    +	
    +	/*
    +	this.uvs = new Float32Array()
    +	this.verticies = new Float32Array()
    +	this.colors = new Float32Array()
    +	this.indices = new Uint16Array()
    +*/
    +	this.width = width;
    +	this.height = height;
    +	
    +	// load the texture!
    +	if(texture.baseTexture.hasLoaded)
    +	{
    +		this.width   = this.texture.frame.width;
    +		this.height  = this.texture.frame.height;
    +		this.updateFrame = true;
    +	}
    +	else
    +	{
    +		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    +		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    +	}
    +	
    +	this.renderable = true;
    +}
    +
    +// constructor
    +PIXI.Strip.constructor = PIXI.Strip;
    +PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    +
    +PIXI.Strip.prototype.setTexture = function(texture)
    +{
    +	//TODO SET THE TEXTURES
    +	//TODO VISIBILITY
    +	
    +	// stop current texture 
    +	this.texture = texture;
    +	this.width   = texture.frame.width;
    +	this.height  = texture.frame.height;
    +	this.updateFrame = true;
    +}
    +
    +PIXI.Strip.prototype.onTextureUpdate = function(event)
    +{
    +	this.updateFrame = true;
    +}
    +// some helper functions..
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_AssetLoader.js.html b/docs/files/pixi_loaders_AssetLoader.js.html new file mode 100644 index 0000000..fc38827 --- /dev/null +++ b/docs/files/pixi_loaders_AssetLoader.js.html @@ -0,0 +1,262 @@ + + + + + pixi/loaders/AssetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/AssetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
    + * When all items have been loaded this class will dispatch a 'loaded' event
    + * As each individual item is loaded this class will dispatch a 'progress' event
    + * @class AssetLoader
    + * @constructor
    + * @extends EventTarget
    + * @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
    + */
    +PIXI.AssetLoader = function(assetURLs)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	
    +	/**
    +	 * The array of asset URLs that are going to be loaded
    +	 * @property assetURLs
    +	 * @type Array
    +	 */
    +	this.assetURLs = assetURLs;
    +	
    +	this.assets = [];
    +}
    +
    +// constructor
    +PIXI.AssetLoader.constructor = PIXI.AssetLoader;
    +
    +/**
    + * This will begin loading the assets sequentially
    + */
    +PIXI.AssetLoader.prototype.load = function()
    +{
    +	this.loadCount = this.assetURLs.length;
    +	var imageTypes = ["jpeg", "jpg", "png", "gif"];
    +	
    +	var spriteSheetTypes = ["json"];
    +	
    +	for (var i=0; i < this.assetURLs.length; i++) 
    +	{
    +		var filename = this.assetURLs[i];
    +		var fileType = filename.split('.').pop().toLowerCase();
    +		// what are we loading?
    +		var type;
    +		
    +		for (var j=0; j < imageTypes.length; j++) 
    +		{
    +			if(fileType == imageTypes[j])
    +			{
    +				type = "img";
    +				break;
    +			}
    +		}
    +		
    +		if(!type)
    +		{
    +			for (var j=0; j < spriteSheetTypes.length; j++) 
    +			{
    +				if(fileType == spriteSheetTypes[j])
    +				{
    +					type = "atlas";
    +					break;
    +				}
    +			}
    +		}
    +		
    +		if(type == "img")
    +		{
    +			var texture = PIXI.Texture.fromImage(filename);
    +			if(!texture.hasLoaded)
    +			{
    +				
    +				var scope = this;
    +				texture.baseTexture.addEventListener( 'loaded', function ( event ) 
    +				{
    +					scope.onAssetLoaded();
    +				});
    +	
    +				this.assets.push(texture);
    +			}
    +			else
    +			{
    +				
    +				// already loaded!
    +				this.loadCount--;
    +			}
    +			
    +		}
    +		else if(type == "atlas")
    +		{
    +			var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
    +			this.assets.push(spriteSheetLoader);
    +			
    +			var scope = this;
    +			spriteSheetLoader.addEventListener( 'loaded', function ( event ) 
    +			{
    +				scope.onAssetLoaded();
    +			});
    +			
    +			spriteSheetLoader.load();
    +		}
    +		else
    +		{
    +			// dont know what the file is! :/
    +			//this.loadCount--;
    +			throw new Error(filename + " is an unsupported file type " + this);
    +		}
    +		
    +		//this.assets[i].load();
    +	};
    +}
    +
    +PIXI.AssetLoader.prototype.onAssetLoaded = function()
    +{
    +	this.loadCount--;
    +	this.dispatchEvent( { type: 'progress', content: this } );
    +	
    +	if(this.loadCount == 0)
    +	{
    +		this.dispatchEvent( { type: 'loaded', content: this } );
    +	}
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_loaders_SpriteSheetLoader.js.html b/docs/files/pixi_loaders_SpriteSheetLoader.js.html new file mode 100644 index 0000000..da4a0ea --- /dev/null +++ b/docs/files/pixi_loaders_SpriteSheetLoader.js.html @@ -0,0 +1,236 @@ + + + + + pixi/loaders/SpriteSheetLoader.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/loaders/SpriteSheetLoader.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * The sprite sheet loader is used to load in JSON sprite sheet data
    + * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
    + * There is a free version so thats nice, although the paid version is great value for money.
    + * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
    + * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
    + * This loader will also load the image file that the Spritesheet points to as well as the data.
    + * When loaded this class will dispatch a 'loaded' event
    + * @class SpriteSheetLoader
    + * @extends EventTarget
    + * @constructor
    + * @param url {String} the url of the sprite sheet JSON file
    + */
    +
    +PIXI.SpriteSheetLoader = function(url)
    +{
    +	/*
    +	 * i use texture packer to load the assets..
    +	 * http://www.codeandweb.com/texturepacker
    +	 * make sure to set the format as "JSON"
    +	 */
    +	PIXI.EventTarget.call( this );
    +	this.url = url;
    +	this.baseUrl = url.replace(/[^\/]*$/, '');
    +	this.texture;
    +	this.frames = {};	
    +}
    +
    +// constructor
    +PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
    +
    +/**
    + * This will begin loading the JSON file
    + */
    +PIXI.SpriteSheetLoader.prototype.load = function()
    +{
    +	this.ajaxRequest = new AjaxRequest();
    +	var scope = this;
    +	this.ajaxRequest.onreadystatechange=function()
    +	{
    +		scope.onLoaded();
    +	}
    +		
    +	this.ajaxRequest.open("GET", this.url, true)
    +	this.ajaxRequest.send(null)
    +}
    +
    +PIXI.SpriteSheetLoader.prototype.onLoaded = function()
    +{
    +	if (this.ajaxRequest.readyState==4)
    +	{
    +		 if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
    +	 	{
    +			var jsondata = eval("("+this.ajaxRequest.responseText+")");
    +			
    +			var textureUrl = this.baseUrl + jsondata.meta.image;
    +			
    +			this.texture = PIXI.Texture.fromImage(textureUrl).baseTexture;
    +			
    +		//	if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
    +			
    +			var frameData = jsondata.frames;
    +			for (var i in frameData) 
    +			{
    +				var rect = frameData[i].frame;
    +				PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
    +				
    +				if(frameData[i].trimmed)
    +				{
    +					//var realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
    +					PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
    +					// calculate the offset!
    +				}
    +//				this.frames[i] = ;
    +   			}
    +			
    +			if(this.texture.hasLoaded)
    +			{
    +				this.dispatchEvent( { type: 'loaded', content: this } );
    +			}
    +			else
    +			{
    +				var scope = this;
    +				// wait for the texture to load..
    +				this.texture.addEventListener('loaded', function(){
    +					
    +					scope.dispatchEvent( { type: 'loaded', content: scope } );
    +					
    +				});
    +			}
    +	 	}
    +	}
    +	
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_CanvasRenderer.js.html b/docs/files/pixi_renderers_CanvasRenderer.js.html new file mode 100644 index 0000000..8c2889a --- /dev/null +++ b/docs/files/pixi_renderers_CanvasRenderer.js.html @@ -0,0 +1,400 @@ + + + + + pixi/renderers/CanvasRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/CanvasRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class CanvasRenderer
    + * @param width {Number} the width of the canvas view
    + * @param height {Number} the height of the canvas view
    + */
    +PIXI.CanvasRenderer = function(width, height)
    +{
    +	/**
    +	 * The width of the canvas view
    +	 * @property width
    +	 * @type Number
    +	 * @default 800
    +	 */
    +	this.width = width ? width : 800;
    +	/**
    +	 * The height of the canvas view
    +	 * @property height
    +	 * @type Number
    +	 * @default 600
    +	 */
    +	this.height = height ? height : 600;
    +	
    +	this.refresh = true;
    +	
    +	/**
    +	 * The canvas element that the everything is drawn to
    +	 * @property view
    +	 * @type Canvas
    +	 */
    +	this.view = document.createElement( 'canvas' ); 
    +	
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	this.count = 0;
    +	
    +	/**
    +	 * The canvas context that the everything is drawn to
    +	 * @property context
    +	 * @type Canvas 2d Context
    +	 */
    +	this.context = this.view.getContext("2d");
    +}
    +
    +// constructor
    +PIXI.CanvasRenderer.constructor = PIXI.CanvasRenderer;
    +
    +/**
    + * Renders the stage to its canvas view
    + * @method render
    + * @param stage {Stage} the Stage element to be rendered
    + */
    +PIXI.CanvasRenderer.prototype.render = function(stage)
    +{
    +	// update children if need be
    +	
    +	stage.__childrenAdded = [];
    +	stage.__childrenRemoved = [];
    +	
    +	// update textures if need be
    +	PIXI.texturesToUpdate = [];
    +	
    +	
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	stage.updateTransform();
    +	  
    +	this.context.setTransform(1,0,0,1,0,0); 
    +	this.context.clearRect(0, 0, this.width, this.height)
    +    this.renderDisplayObject(stage);
    +}
    +
    +/**
    + * resizes the canvas view to the specified width and height
    + * @param the new width of the canvas view
    + * @param the new height of the canvas view
    + */
    +PIXI.CanvasRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
    +{
    +	var transform = displayObject.worldTransform;
    +	var context = this.context;
    +	context.globalCompositeOperation = "source-over"
    +	var blit = false;
    +	
    +	if(!displayObject.visible)return;
    +		
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var frame = displayObject.texture.frame;
    +		
    +		if(frame)
    +		{
    +			context.globalAlpha = displayObject.worldAlpha;
    +			
    +			// BLITZ!!!
    +			/*
    +			 * if the rotation is 0 then we can blitz it
    +			 * meaning we dont need to do a transform and also we
    +			 * can round to the nearest round number for a little extra speed!
    +			 */
    +			if(displayObject.rotation == 0)
    +			{
    +				if(!blit)this.context.setTransform(1,0,0,1,0,0); 
    +				blit = true;
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (transform[2]+ ((displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width) * transform[0]),
    +								   (transform[5]+ ((displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height)* transform[4]),
    +								   (displayObject.width * transform[0]),
    +								   (displayObject.height * transform[4]));
    +				
    +			}	
    +			else
    +			{
    +				blit = false;
    +				context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +				context.drawImage(displayObject.texture.baseTexture.image, 
    +								   frame.x,
    +								   frame.y,
    +								   frame.width,
    +								   frame.height,
    +								   (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width, 
    +								   (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
    +								   displayObject.width,
    +								   displayObject.height);
    +			}
    +		}					   
    +   	}
    +   	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
    +		this.renderStrip(displayObject);
    +	}
    +	
    +	// render!
    +	for (var i=0; i < displayObject.children.length; i++) 
    +	{
    +		this.renderDisplayObject(displayObject.children[i]);
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStripFlat = function(strip)
    +{
    +	var context = this.context;
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	
    +	context.beginPath();
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		
    +	};	
    +	
    +//	context.globalCompositeOperation = 'lighter';
    +	context.fillStyle = "#FF0000";
    +	context.fill();
    +	context.closePath();
    +	//context.globalCompositeOperation = 'source-over';	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
    +{
    +	var context = this.context;
    +	//context.globalCompositeOperation = 'lighter';
    +	// draw triangles!!
    +	var verticies = strip.verticies;
    +	var uvs = strip.uvs;
    +	
    +	var length = verticies.length/2;
    +	this.count++;
    +	for (var i=1; i < length-2; i++) 
    +	{
    +		
    +		// draw some triangles!
    +		var index = i*2;
    +		
    +		 var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    + 		 var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    + 		 
    +  		 var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2]* strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    +   		 var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3]* strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    +
    +
    +		context.save();
    +		context.beginPath();
    +		context.moveTo(x0, y0);
    +		context.lineTo(x1, y1);
    +		context.lineTo(x2, y2);
    +		context.closePath();
    +		
    +	//	context.fillStyle = "white"//rgb(1, 1, 1,1));
    +	//	context.fill();
    +		context.clip();
    +		
    +		
    +        // Compute matrix transform
    +        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    +        var delta_a = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    +        var delta_b = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    +        var delta_c = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    +        var delta_d = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    +        var delta_e = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    +        var delta_f = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    +		
    +		
    +		
    +		    
    +        context.transform(delta_a/delta, delta_d/delta,
    +                      delta_b/delta, delta_e/delta,
    +                      delta_c/delta, delta_f/delta);
    +                 
    +		context.drawImage(strip.texture.baseTexture.image, 0, 0);
    +	  	context.restore();
    +	};
    +	
    +//	context.globalCompositeOperation = 'source-over';	
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLBatch.js.html b/docs/files/pixi_renderers_WebGLBatch.js.html new file mode 100644 index 0000000..92ea7ac --- /dev/null +++ b/docs/files/pixi_renderers_WebGLBatch.js.html @@ -0,0 +1,693 @@ + + + + + pixi/renderers/WebGLBatch.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLBatch.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._batchs = [];
    +
    +/**
    + * @private
    + */
    +PIXI._getBatch = function(gl)
    +{
    +	if(PIXI._batchs.length == 0)
    +	{
    +		return new PIXI.WebGLBatch(gl);
    +	}
    +	else
    +	{
    +		return PIXI._batchs.pop();
    +	}
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._returnBatch = function(batch)
    +{
    +	batch.clean();	
    +	PIXI._batchs.push(batch);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI._restoreBatchs = function(gl)
    +{
    +	for (var i=0; i < PIXI._batchs.length; i++) 
    +	{
    +	  PIXI._batchs[i].restoreLostContext(gl);
    +	};
    +}
    +
    +/**
    + * A WebGLBatch Enables a group of sprites to be drawn using the same settings.
    + * if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run. 
    + * @class WebGLBatch
    + * @param an instance of the webGL context
    + * @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
    + */
    +PIXI.WebGLBatch = function(gl)
    +{
    +	this.gl = gl;
    +	
    +	this.size = 0;
    +
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +	this.blendMode = PIXI.blendModes.NORMAL;
    +	this.dynamicSize = 1;
    +}
    +
    +
    +// constructor
    +PIXI.WebGLBatch.constructor = PIXI.WebGLBatch;
    +
    +/**
    + * Cleans the batch so that is can be returned to an object pool and reused
    + */
    +PIXI.WebGLBatch.prototype.clean = function()
    +{
    +	this.verticies = [];
    +	this.uvs = [];
    +	this.indices = [];
    +	this.colors = [];
    +	//this.sprites = [];
    +	this.dynamicSize = 1;
    +	this.texture = null;
    +	this.last = null;
    +	this.size = 0;
    +	
    +	this.head;
    +	this.tail;
    +}
    +
    +/*
    + * recreates the buffers in the event of a context loss
    + */
    +PIXI.WebGLBatch.prototype.restoreLostContext = function(gl)
    +{
    +	this.gl = gl;
    +	this.vertexBuffer =  gl.createBuffer();
    +	this.indexBuffer =  gl.createBuffer();
    +	this.uvBuffer =  gl.createBuffer();
    +	this.colorBuffer =  gl.createBuffer();
    +}
    +
    +/**
    + * inits the batch's texture and blend mode based if the supplied sprite
    + * @method init
    + * @param sprite {Sprite} the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch
    + */	
    +PIXI.WebGLBatch.prototype.init = function(sprite)
    +{
    +	sprite.batch = this;
    +	this.dirty = true;
    +	this.blendMode = sprite.blendMode;
    +	this.texture = sprite.texture.baseTexture;
    +//	this.sprites.push(sprite);
    +	this.head = sprite;
    +	this.tail = sprite;
    +	this.size = 1;
    +	
    +	this.growBatch();
    +}
    +
    +/**
    + * inserts a sprite before the specified sprite
    + * @method insertBefore
    + * @param sprite {Sprite} the sprite to be added
    + * @param nextSprite {nextSprite} the first sprite will be inserted before this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertBefore = function(sprite, nextSprite)
    +{
    +	this.size++;
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	var tempPrev = nextSprite.__prev;
    +	nextSprite.__prev = sprite;
    +	sprite.__next = nextSprite;
    +	
    +	if(tempPrev)
    +	{
    +		sprite.__prev = tempPrev;
    +		tempPrev.__next = sprite;
    +	}
    +	else
    +	{
    +		this.head = sprite;
    +		//this.head.__prev = null
    +	}
    +}
    +
    +/**
    + * inserts a sprite after the specified sprite
    + * @method insertAfter
    + * @param sprite {Sprite} the sprite to be added
    + * @param  previousSprite {Sprite} the first sprite will be inserted after this sprite
    + */	
    +PIXI.WebGLBatch.prototype.insertAfter = function(sprite, previousSprite)
    +{
    +	this.size++;
    +	
    +	
    +	sprite.batch = this;
    +	this.dirty = true;
    +	
    +	var tempNext = previousSprite.__next;
    +	previousSprite.__next = sprite;
    +	sprite.__prev = previousSprite;
    +	
    +	if(tempNext)
    +	{
    +		sprite.__next = tempNext;
    +		tempNext.__prev = sprite;
    +	}
    +	else
    +	{
    +		this.tail = sprite
    +	}
    +	
    +}
    +
    +/**
    + * removes a sprite from the batch
    + * @method remove
    + * @param sprite {Sprite} the sprite to be removed
    + */	
    +PIXI.WebGLBatch.prototype.remove = function(sprite)
    +{
    +	this.size--;
    +	
    +	if(this.size == 0)
    +	{
    +		sprite.batch = null;
    +		sprite.__prev = null;
    +		sprite.__next = null;
    +		return;
    +	}
    +	
    +	if(sprite.__prev)
    +	{
    +		sprite.__prev.__next = sprite.__next;
    +	}
    +	else
    +	{
    +		this.head = sprite.__next;
    +		this.head.__prev = null;
    +	}
    +	
    +	if(sprite.__next)
    +	{
    +		sprite.__next.__prev = sprite.__prev;
    +	}
    +	else
    +	{
    +		this.tail = sprite.__prev;
    +		this.tail.__next = null
    +	}
    +	
    +	sprite.batch = null;
    +	sprite.__next = null;
    +	sprite.__prev = null;
    +	this.dirty = true;
    +}
    +
    +/**
    + * Splits the batch into two with the specified sprite being the start of the new batch.
    + * @method split
    + * @param sprite {Sprite} the sprite that indicates where the batch should be split
    + * @return {WebGLBatch} the new batch
    + */
    +PIXI.WebGLBatch.prototype.split = function(sprite)
    +{
    +	
    +	//console.log("Splitting batch :" + this.size)
    +//	console.log(sprite)
    +//	console.log("-------")
    +	this.dirty = true;
    +	
    +	//var val = (this.tail == this.head)
    +	//console.log(val + " SAME?");
    +	var batch = new PIXI.WebGLBatch(this.gl)//PIXI._getBatch(this.gl);
    +	batch.init(sprite);
    +	batch.tail = this.tail;
    +	//console.log("id is " +batcheee.id)
    +	
    +	this.tail = sprite.__prev;
    +	this.tail.__next = null;
    +	
    +	sprite.__prev = null;
    +	// return a splite batch!
    +	//sprite.__prev.__next = null;
    +	//sprite.__prev = null;
    +	
    +	
    +	// TODO this size is wrong!
    +	// need to recalculate :/ problem with a linked list!
    +	// unless it gets calculated in the "clean"?
    +	
    +	// need to loop through items as there is no way to know the length on a linked list :/
    +	var tempSize = 0;
    +	while(sprite)
    +	{
    +		tempSize++;
    +		sprite.batch = batch;
    +		sprite = sprite.__next;
    +	}
    +	
    +	batch.size = tempSize;
    +	this.size -= tempSize;
    +	
    +	return batch;
    +}
    +
    +/**
    + * Merges two batchs together
    + * @method merge
    + * @param batch {WebGLBatch} the batch that will be merged 
    + */
    +PIXI.WebGLBatch.prototype.merge = function(batch)
    +{
    +	this.dirty = true;
    +	
    +	this.tail.__next = batch.head;
    +	batch.head.__prev = this.tail;
    +	
    +	this.size += batch.size;
    +			
    +	this.tail = batch.tail;
    +	
    +	var sprite = batch.head;
    +	while(sprite)
    +	{
    +		sprite.batch = this;
    +		sprite = sprite.__next;
    +	}
    +	
    +}
    +
    +/**
    + * Grows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added
    + * @methos growBatch
    + */
    +PIXI.WebGLBatch.prototype.growBatch = function()
    +{
    +	var gl = this.gl;
    +	if( this.size == 1)
    +	{
    +		this.dynamicSize = 1;
    +	}
    +	else
    +	{
    +		this.dynamicSize = this.size * 1.5
    +	}
    +	// grow verts
    +	this.verticies = new Float32Array(this.dynamicSize * 8);
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER,this.verticies , gl.DYNAMIC_DRAW);
    +	
    +	this.uvs  = new Float32Array( this.dynamicSize * 8 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.uvs , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyUVS = true;
    +	
    +	this.colors  = new Float32Array( this.dynamicSize * 4 )  
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, this.colors , gl.DYNAMIC_DRAW);
    +	
    +	this.dirtyColors = true;
    +	
    +	this.indices = new Uint16Array(this.dynamicSize * 6); 
    +	var length = this.indices.length/6;
    +	
    +	for (var i=0; i < length; i++) 
    +	{
    +	    var index2 = i * 6;
    +	    var index3 = i * 4;
    +		this.indices[index2 + 0] = index3 + 0;
    +		this.indices[index2 + 1] = index3 + 1;
    +		this.indices[index2 + 2] = index3 + 2;
    +		this.indices[index2 + 3] = index3 + 0;
    +		this.indices[index2 + 4] = index3 + 2;
    +		this.indices[index2 + 5] = index3 + 3;
    +	};
    +	
    +	gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    +	
    +}
    +
    +/**
    + * Refresh's all the data in the batch and sync's it with the webGL buffers
    + * @method refresh
    + */
    +PIXI.WebGLBatch.prototype.refresh = function()
    +{
    +	var gl = this.gl;
    +	
    +	if (this.dynamicSize < this.size)
    +	{
    +		this.growBatch();
    +	}
    +
    +	var indexRun = 0;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index
    +	var a, b, c, d, tx, ty
    +	
    +	var displayObject = this.head
    +
    +	while(displayObject)
    +	{
    +		index = indexRun * 8;
    +		
    +		var texture = displayObject.texture;
    +			
    +		var frame = texture.frame;
    +		var tw = texture.baseTexture.width;
    +		var th = texture.baseTexture.height;
    +		
    +		this.uvs[index + 0] = frame.x / tw;
    +		this.uvs[index +1] = frame.y / th;
    +		
    +		this.uvs[index +2] = (frame.x + frame.width) / tw;
    +		this.uvs[index +3] = frame.y / th;
    +		
    +		this.uvs[index +4] = (frame.x + frame.width) / tw;
    +		this.uvs[index +5] = (frame.y + frame.height) / th; 
    +		
    +		this.uvs[index +6] = frame.x / tw;
    +		this.uvs[index +7] = (frame.y + frame.height) / th;
    +		
    +		displayObject.updateFrame = false;
    +		
    +		colorIndex = indexRun * 4;
    +		this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +		
    +		displayObject = displayObject.__next;
    +		
    +		indexRun ++;
    +	}
    +	
    +	this.dirtyUVS = true;
    +	this.dirtyColors = true;
    +}
    +
    +/**
    + * Updates all the relevant geometry and uploads the data to the GPU
    + * @method update
    + */
    +PIXI.WebGLBatch.prototype.update = function()
    +{
    +	var gl = this.gl;
    +	var worldTransform, width, height, aX, aY, w0, w1, h0, h1, index, index2, index3
    +	
    +	var a, b, c, d, tx, ty;
    +	
    +	var indexRun = 0;
    +	
    +	var displayObject = this.head;
    +	
    +	while(displayObject)
    +	{
    +		width = displayObject.width;
    +		height = displayObject.height;
    +		
    +		aX = displayObject.anchor.x - displayObject.texture.trim.x
    +		aY = displayObject.anchor.y - displayObject.texture.trim.y
    +		w0 = width * (1-aX);
    +		w1 = width * -aX;
    +		 
    +		h0 = height * (1-aY);
    +		h1 = height * -aY;
    +		 
    +		index = indexRun * 8;
    +
    +		worldTransform = displayObject.worldTransform;
    +	
    +		a = worldTransform[0];
    +		b = worldTransform[3];
    +		c = worldTransform[1];
    +		d = worldTransform[4];
    +		tx = worldTransform[2];
    +		ty = worldTransform[5];
    +		
    +		this.verticies[index + 0 ] = a * w1 + c * h1 + tx; 
    +		this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
    +		 
    +		this.verticies[index + 2 ] = a * w0 + c * h1 + tx; 
    +		this.verticies[index + 3 ] = d * h1 + b * w0 + ty; 
    +		
    +		this.verticies[index + 4 ] = a * w0 + c * h0 + tx; 
    +		this.verticies[index + 5 ] = d * h0 + b * w0 + ty; 
    +		
    +		this.verticies[index + 6] =  a * w1 + c * h0 + tx; 
    +		this.verticies[index + 7] =  d * h0 + b * w1 + ty; 
    +		
    +		if(displayObject.updateFrame)
    +		{
    +			this.dirtyUVS = true;
    +			
    +			var texture = displayObject.texture;
    +			
    +			var frame = texture.frame;
    +			var tw = texture.baseTexture.width;
    +			var th = texture.baseTexture.height;
    +			
    +			this.uvs[index + 0] = frame.x / tw;
    +			this.uvs[index +1] = frame.y / th;
    +			
    +			this.uvs[index +2] = (frame.x + frame.width) / tw;
    +			this.uvs[index +3] = frame.y / th;
    +			
    +			this.uvs[index +4] = (frame.x + frame.width) / tw;
    +			this.uvs[index +5] = (frame.y + frame.height) / th; 
    +			
    +			this.uvs[index +6] = frame.x / tw;
    +			this.uvs[index +7] = (frame.y + frame.height) / th;
    +			
    +			displayObject.updateFrame = false;
    +		}
    +		
    +		// TODO this probably could do with some optimisation....
    +		if(displayObject.cacheAlpha != displayObject.worldAlpha)
    +		{
    +			displayObject.cacheAlpha = displayObject.worldAlpha;
    +			
    +			var colorIndex = indexRun * 4;
    +			this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
    +			this.dirtyColors = true;
    +		}
    +		
    +		indexRun++;
    +		displayObject = displayObject.__next;
    +   }
    +}
    +
    +/**
    + * Draws the batch to the frame buffer
    + * @method render
    + */
    +PIXI.WebGLBatch.prototype.render = function()
    +{
    +	if(this.dirty)
    +	{
    +		this.refresh();
    +		this.dirty = false;
    +	}
    +	
    +	if (this.size == 0)return;
    +	
    +	this.update();
    +	var gl = this.gl;
    +	
    +	//TODO optimize this!
    +	if(this.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	var shaderProgram = PIXI.shaderProgram;
    +	
    +	// update the verts..
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    +	// ok..
    +	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
    +    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +	// update the uvs
    +   	gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    +
    +    if(this.dirtyUVS)
    +    {
    +    	this.dirtyUVS = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER,  0, this.uvs);
    +    }
    +    
    +    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +	
    +    gl.activeTexture(gl.TEXTURE0);
    +    gl.bindTexture(gl.TEXTURE_2D, this.texture._glTexture);
    +	
    +	// update color!
    +	gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    +
    +	if(this.dirtyColors)
    +    {
    +    	this.dirtyColors = false;
    +    	gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.colors);
    +	}
    +	
    +    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +	
    +	// dont need to upload!
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    +	    
    +    // DRAW THAT this!
    +    gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLRenderer.js.html b/docs/files/pixi_renderers_WebGLRenderer.js.html new file mode 100644 index 0000000..6a965c4 --- /dev/null +++ b/docs/files/pixi_renderers_WebGLRenderer.js.html @@ -0,0 +1,823 @@ + + + + + pixi/renderers/WebGLRenderer.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLRenderer.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
    +
    +/**
    + * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
    + * Dont forget to add the view to your DOM or you will not see anything :)
    + * @class WebGLRenderer
    + * @param width {Number} the width of the canvas view
    + * @default 0
    + * @param height {Number} the height of the canvas view
    + * @default 0
    + */
    +PIXI.WebGLRenderer = function(width, height)
    +{
    +	this.width = width ? width : 800;
    +	this.height = height ? height : 600;
    +	
    +	this.view = document.createElement( 'canvas' ); 
    +    this.view.width = this.width;
    +	this.view.height = this.height;  
    +	this.view.background = "#FF0000";
    +	
    +	// deal with losing context..	
    +    var scope = this;
    +	this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false)
    +	this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false)
    +
    +	this.batchs = [];
    +	
    +	try 
    + 	{
    +        this.gl = this.view.getContext("experimental-webgl",  {  	
    +    		 alpha: false
    +        });
    +    } 
    +    catch (e) 
    +    {
    +    	throw new Error(" This browser does not support webGL. Try using the canvas renderer" + this);
    +    }
    +    
    +    this.initShaders();
    +    
    +    
    +    var gl = this.gl;
    +    
    +    this.batch = new PIXI.WebGLBatch(gl);
    +   	gl.disable(gl.DEPTH_TEST);
    +    gl.enable(gl.BLEND);
    +    gl.colorMask(true, true, true, false); 
    +    
    +    this.projectionMatrix =  mat4.create();
    +    
    +    this.resize(this.width, this.height)
    +    this.contextLost = false;
    +}
    +
    +// constructor
    +PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initShaders = function() 
    +{
    +	var gl = this.gl;
    +	var fragmentShader = PIXI.CompileFragmentShader(gl, PIXI.shaderFragmentSrc);
    +	var vertexShader = PIXI.CompileVertexShader(gl, PIXI.shaderVertexSrc);
    +	
    +	this.shaderProgram = gl.createProgram();
    +	
    +	var shaderProgram = this.shaderProgram;
    +	
    +    gl.attachShader(shaderProgram, vertexShader);
    +    gl.attachShader(shaderProgram, fragmentShader);
    +    gl.linkProgram(shaderProgram);
    +
    +    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    +        alert("Could not initialise shaders");
    +    }
    +
    +    gl.useProgram(shaderProgram);
    +
    +    shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
    +    gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
    +
    +    shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
    +    gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
    +	
    +	shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
    +    gl.enableVertexAttribArray(shaderProgram.colorAttribute);
    +
    +
    +    shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    +    shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
    +	
    +	PIXI.shaderProgram = this.shaderProgram;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
    +{
    +	var children = displayObject.children;
    +	
    +	
    +	for (var i=0; i < children.length; i++) 
    +	{
    +		var child = children[i];
    +		
    +		// TODO optimize... shouldt need to loop through everything all the time
    +		var actualVisibility = child.visible && globalVisible;
    +		
    +		// everything should have a batch!
    +		// time to see whats new!
    +		if(child.textureChange)
    +		{
    +			child.textureChange = false;
    +			if(actualVisibility)
    +			{
    +				this.removeDisplayObject(child)
    +				this.addDisplayObject(child)
    +			}
    +			// update texture!!
    +		}
    +		
    +		
    +		
    +		if(child.cacheVisible != actualVisibility)
    +		{
    +			child.cacheVisible = actualVisibility;
    +			
    +			if(child.cacheVisible)
    +			{
    +				this.addDisplayObject(child);
    +			}
    +			else
    +			{
    +				this.removeDisplayObject(child);
    +			}
    +		}
    +		
    +		if(child.children.length > 0)
    +		{
    +			this.checkVisibility(child, actualVisibility);
    +		}
    +		
    +		
    +	};
    +}
    +
    +
    +/**
    + * Renders the stage to its webGL view
    + * @method render
    + * @param stage {Stage} the PIXI.Stage element to be rendered
    + */
    +PIXI.WebGLRenderer.prototype.render = function(stage)
    +{
    +	if(this.contextLost)return;
    +	
    +	// update children if need be
    +	// best to remove first!
    +	for (var i=0; i < stage.__childrenRemoved.length; i++)
    +	{
    +		this.removeDisplayObject(stage.__childrenRemoved[i]);
    +	//	stage.__childrenRemoved[i].cacheVisible = false;
    +	}
    +	/*
    +	// no add all new sprites		
    +	for (var i=0; i < stage.__childrenAdded.length; i++) 
    +	{
    +		stage.__childrenAdded[i].cacheVisible = false;
    +//		this.addDisplayObject(stage.__childrenAdded[i]);
    +	}*/
    +	// update any textures	
    +	for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
    +	
    +	// empty out the arrays
    +	stage.__childrenRemoved = [];
    +	stage.__childrenAdded = [];
    +	PIXI.texturesToUpdate = [];
    +	
    +	// recursivly loop through all items!
    +	this.checkVisibility(stage, true);
    +	
    +	// update the scen graph	
    +	stage.updateTransform();
    +	
    +	var gl = this.gl;
    +	
    +	gl.clear(gl.COLOR_BUFFER_BIT)
    +
    +	gl.clearColor(0, 0, 0, 1.0);     
    +	
    +	// set the correct blend mode!
    + 	gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +   
    +	// render all the batchs!	
    +	
    +	
    +	var renderable;
    +	for (var i=0; i < this.batchs.length; i++) 
    +	{
    +		renderable = this.batchs[i];
    +		if(renderable instanceof PIXI.WebGLBatch)
    +		{
    +			this.batchs[i].render();
    +		}
    +		else if(renderable instanceof PIXI.Strip)
    +		{
    +			if(renderable.visible)this.renderStrip(renderable);
    +		}
    +	}
    +	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    +{
    +	var gl = this.gl;
    +	
    +	if(!texture._glTexture)
    +	{
    +		texture._glTexture = gl.createTexture();
    +	}
    +	
    +	if(texture.hasLoaded)
    +	{
    +		gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
    +	 	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
    +		gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    +		gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    +
    +	//	gl.generateMipmap(gl.TEXTURE_2D);
    +		gl.bindTexture(gl.TEXTURE_2D, null);
    +	}
    +	
    +	this.refreshBatchs = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
    +{
    +	
    +	if(!displayObject.stage)return; // means it was removed 
    +	if(displayObject.__inWebGL)return; //means it is already in webgL
    +	
    +	//displayObject.cacheVisible = displayObject.visible;
    +	
    +	// TODO if objects parent is not visible then dont add to stage!!!!
    +	//if(!displayObject.visible)return;
    +
    +	
    +	displayObject.batch = null;
    +	
    +	//displayObject.cacheVisible = true;
    +	if(!displayObject.renderable)return;
    +
    +	// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
    +	displayObject.__inWebGL = true;
    +
    +	/*
    +	 *  LOOK FOR THE PREVIOUS SPRITE
    +	 *  This part looks for the closest previous sprite that can go into a batch
    +	 *  It keeps going back until it finds a sprite or the stage
    +	 */
    +	var previousSprite = displayObject;
    +	do
    +	{
    +		if(previousSprite.childIndex == 0)
    +		{
    +			previousSprite = previousSprite.parent;
    +			
    +		}
    +		else
    +		{
    +			previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
    +			// what if the bloop has children???
    +			while(previousSprite.children.length != 0)
    +			{
    +				// keep diggin till we get to the last child
    +				previousSprite = previousSprite.children[previousSprite.children.length-1];
    +			}
    +		}
    +		
    +		if(previousSprite == displayObject.stage)break;
    +	}
    +	while(!previousSprite.renderable || !previousSprite.__inWebGL)
    +	//while(!(previousSprite instanceof PIXI.Sprite))
    +
    +	/*
    +	 *  LOOK FOR THE NEXT SPRITE
    +	 *  This part looks for the closest next sprite that can go into a batch
    +	 *  it keeps looking until it finds a sprite or gets to the end of the display
    +	 *  scene graph
    +	 * 
    +	 *  These look a lot scarier than the actually are...
    +	 */
    +	var nextSprite = displayObject;
    +	do
    +	{
    +		// moving forward!
    +		// if it has no children.. 
    +		if(nextSprite.children.length == 0)
    +		{
    +			// go along to the parent..
    +			while(nextSprite.childIndex == nextSprite.parent.children.length-1)
    +			{
    +				nextSprite = nextSprite.parent;
    +				if(nextSprite == displayObject.stage)
    +				{
    +					nextSprite = null
    +					break;
    +				}
    +			}
    +			
    +			if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
    +			
    +		}
    +		else
    +		{
    +			nextSprite = nextSprite.children[0];
    +		}
    +
    +		if(!nextSprite)break;
    +	}
    +	while(!nextSprite.renderable || !nextSprite.__inWebGL)
    +	
    +	/*
    +	 * so now we have the next renderable and the previous renderable
    +	 * 
    +	 */
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		var previousBatch
    +		var nextBatch
    +		
    +		if(previousSprite instanceof PIXI.Sprite)
    +		{
    +			previousBatch = previousSprite.batch;
    +			
    +			if(previousBatch)
    +			{
    +				if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
    +				{
    +					previousBatch.insertAfter(displayObject, previousSprite);
    +					return;
    +				}
    +			}
    +		}
    +		else
    +		{
    +			// TODO reword!
    +			previousBatch = previousSprite;
    +		}
    +	
    +		if(nextSprite)
    +		{
    +			if(nextSprite instanceof PIXI.Sprite)
    +			{
    +				nextBatch = nextSprite.batch;
    +			
    +				//batch may not exist if item was added to the display list but not to the webGL
    +				if(nextBatch)
    +				{
    +					if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
    +					{
    +						nextBatch.insertBefore(displayObject, nextSprite);
    +						return;
    +					}
    +					else
    +					{
    +						if(nextBatch == previousBatch)
    +						{
    +							// THERE IS A SPLIT IN THIS BATCH! //
    +							var splitBatch = previousBatch.split(nextSprite);
    +							// COOL!
    +							// add it back into the array	
    +							/*
    +							 * OOPS!
    +							 * seems the new sprite is in the middle of a batch
    +							 * lets split it.. 
    +							 */
    +							var batch = PIXI._getBatch(this.gl);
    +
    +							var index = this.batchs.indexOf( previousBatch );
    +							batch.init(displayObject);
    +							this.batchs.splice(index+1, 0, batch, splitBatch);
    +							
    +							return;
    +						}
    +					}
    +				}
    +			}
    +			else
    +			{
    +				// TODO re-word!
    +				nextBatch = nextSprite;
    +			}
    +		}
    +		
    +		/*
    +		 * looks like it does not belong to any batch!
    +		 * but is also not intersecting one..
    +		 * time to create anew one!
    +		 */
    +		
    +		var batch = PIXI._getBatch(this.gl);
    +		batch.init(displayObject);
    +
    +		if(previousBatch) // if this is invalid it means 
    +		{
    +			var index = this.batchs.indexOf( previousBatch );
    +			this.batchs.splice(index+1, 0, batch);
    +		}
    +		else
    +		{
    +			this.batchs.push(batch);
    +		}
    +	
    +	}
    +	else if(displayObject instanceof PIXI.Strip)
    +	{
    +		// add to a batch!!
    +		this.initStrip(displayObject);
    +		this.batchs.push(displayObject);
    +		
    +	}
    +
    +	// if its somthing else... then custom codes!
    +	this.batchUpdate = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
    +{
    +	//if(displayObject.stage)return;
    +	displayObject.cacheVisible = false;//displayObject.visible;
    +	
    +	if(!displayObject.renderable)return;
    +	
    +	displayObject.__inWebGL = false;
    +		
    +	/*
    +	 * removing is a lot quicker..
    +	 * 
    +	 */
    +	var batchToRemove;
    +	
    +	if(displayObject instanceof PIXI.Sprite)
    +	{
    +		// should always have a batch!
    +		var batch = displayObject.batch;
    +		if(!batch)return; // this means the display list has been altered befre rendering
    +		
    +		batch.remove(displayObject);
    +		
    +		
    +		if(batch.size==0)
    +		{
    +			batchToRemove = batch
    +		}
    +	}
    +	else
    +	{
    +		batchToRemove = displayObject;
    +	}
    +	
    +	/*
    +	 * Looks like there is somthing that needs removing!
    +	 */
    +	if(batchToRemove)	
    +	{
    +		var index = this.batchs.indexOf( batchToRemove );
    +		if(index == -1)return;// this means it was added then removed before rendered
    +		
    +		// ok so.. check to see if you adjacent batchs should be joined.
    +		// TODO may optimise?
    +		if(index == 0 || index == this.batchs.length-1)
    +		{
    +			// wha - eva! just get of the empty batch!
    +			this.batchs.splice(index, 1);
    +			if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +		
    +			return;
    +		}
    +		
    +		if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
    +		{
    +			if(this.batchs[index-1].texture == this.batchs[index+1].texture)
    +			{
    +				//console.log("MERGE")
    +				this.batchs[index-1].merge(this.batchs[index+1]);
    +				
    +				if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +				PIXI._returnBatch(this.batchs[index+1]);
    +				this.batchs.splice(index, 2);
    +				return;
    +			}
    +		}
    +		
    +		
    +		this.batchs.splice(index, 1);
    +		if(batchToRemove instanceof PIXI.WebGLBatch)PIXI._returnBatch(batchToRemove);
    +	}
    +	
    +	
    +}
    +
    +/**
    + * resizes the webGL view to the specified width and height
    + * @method resize
    + * @param width {Number} the new width of the webGL view
    + * @param height {Number} the new height of the webGL view
    + */
    +PIXI.WebGLRenderer.prototype.resize = function(width, height)
    +{
    +	this.width = width;
    +	this.height = height;
    +	
    +	this.view.width = width;
    +	this.view.height = height;
    +	
    +	this.gl.viewport(0, 0, this.width, this.height);	
    +
    +	mat4.identity(this.projectionMatrix);
    +	mat4.scale(this.projectionMatrix, [2/this.width, -2/this.height, 1]);
    +	mat4.translate(this.projectionMatrix, [-this.width/2, -this.height/2, 0]);	
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.initStrip = function(strip)
    +{
    +	// build the strip!
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +	
    +	strip._vertexBuffer = gl.createBuffer();
    +	strip._indexBuffer = gl.createBuffer();
    +	strip._uvBuffer = gl.createBuffer();
    +	strip._colorBuffer = gl.createBuffer();
    +	
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.DYNAMIC_DRAW);
    +
    +	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +    gl.bufferData(gl.ARRAY_BUFFER,  strip.uvs, gl.STATIC_DRAW);
    +
    +    gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW);
    +
    +	
    +    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.renderStrip = function(strip)
    +{
    +	var gl = this.gl;
    +	var shaderProgram = this.shaderProgram;
    +//	mat
    +	var mat4Real = mat3.toMat4(strip.worldTransform);
    +	mat4.transpose(mat4Real);
    +	
    +	mat4.multiply(this.projectionMatrix, mat4Real, mat4Real )
    +
    +	gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, mat4Real);
    +  
    +	if(strip.blendMode == PIXI.blendModes.NORMAL)
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +	}
    +	else
    +	{
    +		gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
    +	}
    +	
    +	if(!strip.dirty)
    +	{
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferSubData(gl.ARRAY_BUFFER, 0, strip.verticies)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +    
    +	
    +	}
    +	else
    +	{
    +		strip.dirty = false;
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._vertexBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.verticies, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
    +		
    +		// update the uvs
    +	   	gl.bindBuffer(gl.ARRAY_BUFFER, strip._uvBuffer);
    +	   	gl.bufferData(gl.ARRAY_BUFFER, strip.uvs, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
    +			
    +	    gl.activeTexture(gl.TEXTURE0);
    +	    gl.bindTexture(gl.TEXTURE_2D, strip.texture.baseTexture._glTexture);
    +		
    +		gl.bindBuffer(gl.ARRAY_BUFFER, strip._colorBuffer);
    +		gl.bufferData(gl.ARRAY_BUFFER, strip.colors, gl.STATIC_DRAW)
    +	    gl.vertexAttribPointer(shaderProgram.colorAttribute, 1, gl.FLOAT, false, 0, 0);
    +		
    +		// dont need to upload!
    +	    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, strip._indexBuffer);
    +	    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, strip.indices, gl.STATIC_DRAW);
    +	    
    +	}
    +	
    +	gl.drawElements(gl.TRIANGLE_STRIP, strip.indices.length, gl.UNSIGNED_SHORT, 0);
    +    
    +    gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
    +  
    +  //  console.log("!!!")
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    +{
    +	event.preventDefault();
    +	this.contextLost = true;
    +}
    +
    +/**
    + * @private
    + */
    +PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
    +{
    +	this.gl = this.view.getContext("experimental-webgl",  {  	
    +		alpha: true
    +    });
    +        
    +	this.initShaders();	
    +	
    +	for (var i=0; i < PIXI.TextureCache.length; i++) 
    +	{
    +		this.updateTexture(PIXI.TextureCache[i]);
    +	};
    +	
    +	for (var i=0; i <  this.batchs.length; i++) 
    +	{
    +		this.batchs[i].restoreLostContext(this.gl)//
    +		this.batchs[i].dirty = true;
    +	};
    +	
    +	PIXI._restoreBatchs(this.gl);
    +	
    +	this.contextLost = false;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_renderers_WebGLShaders.js.html b/docs/files/pixi_renderers_WebGLShaders.js.html new file mode 100644 index 0000000..de4fdff --- /dev/null +++ b/docs/files/pixi_renderers_WebGLShaders.js.html @@ -0,0 +1,204 @@ + + + + + pixi/renderers/WebGLShaders.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/renderers/WebGLShaders.js

    + +
    +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +	
    +PIXI.shaderFragmentSrc = [	"precision mediump float;",
    +					  		"varying vec2 vTextureCoord;",
    +					  		"varying float vColor;",
    +					  		"uniform sampler2D uSampler;",
    +					  		"void main(void) {",
    +					  		"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
    +					  		"gl_FragColor = gl_FragColor * vColor;",
    +					  		"}"];
    +
    +PIXI.shaderVertexSrc = [	"attribute vec2 aVertexPosition;",
    +	    					"attribute vec2 aTextureCoord;",
    +	    					"attribute float aColor;",
    +	  						"uniform mat4 uMVMatrix;",
    +							"varying vec2 vTextureCoord;",
    +							"varying float vColor;",
    +							"void main(void) {",
    +							"gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);",
    +							"vTextureCoord = aTextureCoord;",
    +							"vColor = aColor;",
    +	   					 	"}"]
    +
    +PIXI.CompileVertexShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.VERTEX_SHADER);
    +       
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +
    +PIXI.CompileFragmentShader = function(gl, shaderSrc)
    +{
    +	var src = "";
    +	
    +	for (var i=0; i < shaderSrc.length; i++) {
    +	  src += shaderSrc[i];
    +	};
    +	
    +	var shader;
    +    shader = gl.createShader(gl.FRAGMENT_SHADER);
    +        
    +    gl.shaderSource(shader, src);
    +    gl.compileShader(shader);
    +	
    +    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    +        alert(gl.getShaderInfoLog(shader));
    +        return null;
    +    }
    +    
    +    return shader;
    +}
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_BaseTexture.js.html b/docs/files/pixi_textures_BaseTexture.js.html new file mode 100644 index 0000000..777e388 --- /dev/null +++ b/docs/files/pixi_textures_BaseTexture.js.html @@ -0,0 +1,206 @@ + + + + + pixi/textures/BaseTexture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/BaseTexture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.BaseTextureCache = {};
    +PIXI.texturesToUpdate = [];
    +
    +/**
    + * A texture stores the information that represents an image. All textures have a base texture
    + * @class BaseTexture
    + * @extends EventTarget
    + * @constructor
    + * @param imageUrl {String} image url
    + */
    +PIXI.BaseTexture = function(imageUrl)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	/**
    +	 * The url of the texture
    +	 * @property imageUrl
    +	 * @type String
    +	 */
    +	this.imageUrl = imageUrl;
    +	
    +	/**
    +	 * The html image that is loaded to create the texture
    +	 * @property image
    +	 * @type Image
    +	 */
    +	this.image = new Image();
    +	
    +	var scope = this
    +	this.image.onload = function(){
    +		
    +		scope.hasLoaded = true;
    +		scope.width = scope.image.width;
    +		scope.height = scope.image.height;
    +	
    +		// add it to somewhere...
    +		PIXI.texturesToUpdate.push(scope);
    +		scope.dispatchEvent( { type: 'loaded', content: scope } );
    +	}
    +		
    +	$.proxy(this.onImageLoaded, this);
    +	this.image.src = imageUrl;
    +	
    +	/**
    +	 * [read only] The width of the base texture set when the image has loaded
    +	 * @property width
    +	 * @type Number
    +	 */
    +	this.width = 100;
    +	/**
    +	 * [read only] The height of the base texture set when the image has loaded
    +	 * @property height
    +	 * @type Number
    +	 */
    +	this.height = 100;
    +	
    +	
    +	PIXI.BaseTextureCache[imageUrl] = this;
    +}
    +
    +PIXI.BaseTexture.constructor = PIXI.BaseTexture;
    +/*
    +PIXI.BaseTexture.prototype.onImageLoaded = function(image)
    +{
    +
    +}*/
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_textures_Texture.js.html b/docs/files/pixi_textures_Texture.js.html new file mode 100644 index 0000000..a8ebe42 --- /dev/null +++ b/docs/files/pixi_textures_Texture.js.html @@ -0,0 +1,285 @@ + + + + + pixi/textures/Texture.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/textures/Texture.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +PIXI.TextureCache = {};
    +PIXI.FrameCache = {};
    +
    +/**
    + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
    + * @class Texture
    + * @extends EventTarget
    + * @constructor
    + * @param baseTexture {BaseTexture}
    + * @param frmae {Rectangle}
    + */
    +PIXI.Texture = function(baseTexture, frame)
    +{
    +	PIXI.EventTarget.call( this );
    +	
    +	if(!frame)
    +	{
    +		this.noFrame = true;
    +		frame = new PIXI.Rectangle(0,0,1,1);
    +	}
    +	
    +	this.trim = new PIXI.Point();
    +	
    +	/**
    +	 * The base texture of this texture
    +	 * @property baseTexture
    +	 * @type BaseTexture
    +	 */
    +	this.baseTexture = baseTexture;
    +	
    +	
    +	
    +	/**
    +	 * The frame specifies the region of the base texture that this texture uses
    +	 * @property frame
    +	 * @type #Rectangle
    +	 */
    +	this.frame = frame;
    +	
    +	
    +	
    +	this.scope = this;
    +	
    +	if(baseTexture.hasLoaded)
    +	{
    +		if(!frame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +		this.setFrame(frame);
    +	}
    +	else
    +	{
    +		var scope = this;
    +		baseTexture.addEventListener( 'loaded', function(){ scope.onBaseTextureLoaded()} );
    +	}
    +}
    +
    +PIXI.Texture.constructor = PIXI.Texture;
    +
    +PIXI.Texture.prototype.onBaseTextureLoaded = function(event)
    +{
    +	var baseTexture = this.baseTexture;
    +	baseTexture.removeEventListener( 'loaded', this.onLoaded );
    +	
    +	if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);
    +	this.noFrame = false;
    +	this.width = this.frame.width;
    +	this.height = this.frame.height;
    +	
    +	this.scope.dispatchEvent( { type: 'update', content: this } );
    +}
    +
    +/**
    + * Specifies the rectangle region of the baseTexture
    + * @method setFrame
    + * @param frame {Rectangle}
    + */
    +PIXI.Texture.prototype.setFrame = function(frame)
    +{
    +	this.frame = frame;
    +	this.width = frame.width;
    +	this.height = frame.height;
    +	//this.updateFrame = true;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on an image url
    + * If the image is not in the texture cache it will be  created and loaded
    + * @static
    + * @method fromImage
    + * @param imageUrl {String} The image url of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromImage = function(imageUrl)
    +{
    +	var texture = PIXI.TextureCache[imageUrl];
    +	
    +	if(!texture)
    +	{
    +		var baseTexture = PIXI.BaseTextureCache[imageUrl];
    +		if(!baseTexture) baseTexture = new PIXI.BaseTexture(imageUrl);
    +		texture = new PIXI.Texture(baseTexture);
    +		PIXI.TextureCache[imageUrl] = texture;
    +	}
    +	
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Helper function that returns a texture based on a frame id
    + * If the frame id is not in the texture cache an error will be thrown
    + * @method fromFrameId
    + * @param frameId {String} The frame id of the texture
    + * @return Texture
    + */
    +PIXI.Texture.fromFrameId = function(frameId)
    +{
    +	var texture = PIXI.TextureCache[frameId];
    +	if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);
    +	return texture;
    +}
    +
    +/**
    + * 
    + * Adds a texture to the textureCache. 
    + * @method addTextureToCache
    + * @param texture {Texture}
    + * @param id {String} the id that the texture will be stored against.
    + */
    +PIXI.Texture.addTextureToCache = function(texture, id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +/**
    + * 
    + * Remove a texture from the textureCache. 
    + * @method removeTextureFromCache
    + * @param id {String} the id of the texture to be removed
    + */
    +PIXI.Texture.removeTextureFromCache = function(id)
    +{
    +	PIXI.TextureCache[id] = texture;
    +}
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Detector.js.html b/docs/files/pixi_utils_Detector.js.html new file mode 100644 index 0000000..2c1f3f3 --- /dev/null +++ b/docs/files/pixi_utils_Detector.js.html @@ -0,0 +1,166 @@ + + + + + pixi/utils/Detector.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Detector.js

    + +
    +
    +/**
    + * @author Mat Groves http://matgroves.com/
    + */
    +
    +/**
    + * This helper function will automatically detect which renderer you should be using.
    + * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer
    + * @method autoDetectRenderer
    + * @static
    + * @param width {Number} the width of the renderers view
    + * @param height {Number} the height of the renderers view
    + */
    +PIXI.autoDetectRenderer = function(width, height)
    +{
    +	if(!width)width = 800;
    +	if(!height)height = 600;
    +	
    +	// BORROWED from Mr Doob (mrdoob.com)
    +	var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )()
    +	
    +	//console.log(webgl);
    +	if( webgl )
    +	{
    +		return new PIXI.WebGLRenderer(width, height) 
    +	}
    +	
    +	return	new PIXI.CanvasRenderer(width, height);
    +}
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_EventTarget.js.html b/docs/files/pixi_utils_EventTarget.js.html new file mode 100644 index 0000000..e9025f8 --- /dev/null +++ b/docs/files/pixi_utils_EventTarget.js.html @@ -0,0 +1,184 @@ + + + + + pixi/utils/EventTarget.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/EventTarget.js

    + +
    +
    +/**
    + * https://github.com/mrdoob/eventtarget.js/
    + * THankS mr DOob!
    + */
    +
    +PIXI.EventTarget = function () {
    +
    +	var listeners = {};
    +	
    +	this.addEventListener = function ( type, listener ) {
    +		
    +		
    +		if ( listeners[ type ] === undefined ) {
    +
    +			listeners[ type ] = [];
    +			
    +		}
    +
    +		if ( listeners[ type ].indexOf( listener ) === - 1 ) {
    +
    +			listeners[ type ].push( listener );
    +		}
    +
    +	};
    +
    +	this.dispatchEvent = function ( event ) {
    +		
    +		for ( var listener in listeners[ event.type ] ) {
    +
    +			listeners[ event.type ][ listener ]( event );
    +			
    +		}
    +
    +	};
    +
    +	this.removeEventListener = function ( type, listener ) {
    +
    +		var index = listeners[ type ].indexOf( listener );
    +
    +		if ( index !== - 1 ) {
    +
    +			listeners[ type ].splice( index, 1 );
    +
    +		}
    +
    +	};
    +
    +};
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/pixi_utils_Utils.js.html b/docs/files/pixi_utils_Utils.js.html new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/docs/files/pixi_utils_Utils.js.html @@ -0,0 +1,182 @@ + + + + + pixi/utils/Utils.js - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    File: pixi/utils/Utils.js

    + +
    +
    +/**
    + * Provides requestAnimationFrame in a cross browser way.
    + */
    +window.requestAnimFrame = (function() {
    +  return window.requestAnimationFrame ||
    +         window.webkitRequestAnimationFrame ||
    +         window.mozRequestAnimationFrame ||
    +         window.oRequestAnimationFrame ||
    +         window.msRequestAnimationFrame ||
    +         function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
    +           window.setTimeout(callback, 1000/60);
    +         };
    +})();
    +
    +var AjaxRequest = function()
    +{
    +	var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
    +	
    +	if (window.ActiveXObject)
    +	{ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    +		for (var i=0; i<activexmodes.length; i++)
    +		{
    +			try{
    +				return new ActiveXObject(activexmodes[i])
    +			}
    +   			catch(e){
    +    			//suppress error
    +   			}
    +		}
    +	}
    +	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    +  	{
    +  		return new XMLHttpRequest()
    + 	}
    + 	else
    + 	{
    +		return false;
    + 	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +    
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0041fd4 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,150 @@ + + + + + The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +
    +
    +

    + Browse to a module or class using the sidebar to view its API documentation. +

    + +

    Keyboard Shortcuts

    + +
      +
    • Press s to focus the API search box.

    • + +
    • Use Up and Down to select classes, modules, and search results.

    • + +
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • + +
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html new file mode 100644 index 0000000..fafb8ea --- /dev/null +++ b/docs/modules/PIXI.html @@ -0,0 +1,251 @@ + + + + + PIXI - The Foo API + + + + + + + + +
    +
    +
    + +

    + +
    +
    + API Docs for: 1.2.1 +
    +
    +
    + +
    + +
    +
    +
    + Show: + + + + + + + +
    + + +
    +
    +
    +

    PIXI Module

    +
    + + + + + +
    + Defined in: pixi/Stage.js:5 +
    + + + +
    + + + +
    + +
    + + + +
    +
    + +

    This module provides the following classes:

    + + + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..487fe15 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/examples/bunny benchmark/css/main.css b/examples/bunny benchmark/css/main.css index 08b7410..d2bd14c 100644 --- a/examples/bunny benchmark/css/main.css +++ b/examples/bunny benchmark/css/main.css @@ -3,6 +3,7 @@ border: 0; margin: 0; } + .counter { background: #ccc; width: 74px; @@ -19,3 +20,15 @@ } +#pixi { + background: #ccc; + width: 204px; + height: 100px; + background-color:#105CB6; + color:#0ff; + position:absolute; + font-family: Helvetica, Arial; + font-size: 9px; + font-weight: bold; +} + diff --git a/examples/bunny benchmark/index.html b/examples/bunny benchmark/index.html index 7c5521b..95972c4 100644 --- a/examples/bunny benchmark/index.html +++ b/examples/bunny benchmark/index.html @@ -9,9 +9,10 @@ +
    Click to add more bunnys! Let me know how many you get on screen here @doormat23
    - + diff --git a/examples/bunny benchmark/js/bunnyBenchMark.js b/examples/bunny benchmark/js/bunnyBenchMark.js index a3154eb..c3c8ec5 100644 --- a/examples/bunny benchmark/js/bunnyBenchMark.js +++ b/examples/bunny benchmark/js/bunnyBenchMark.js @@ -22,18 +22,13 @@ var count = 0; var container; +var detail; + function onReady() { - var webgl = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )() + detail = document.getElementById("pixi"); - if(webgl) - { - renderer = new PIXI.WebGLRenderer(); - } - else - { - renderer = new PIXI.CanvasRenderer(480, 320); - } + renderer = PIXI.autoDetectRenderer(); stage = new PIXI.Stage; @@ -46,7 +41,7 @@ stats.domElement.style.top = "0px"; requestAnimFrame(update); - wabbitTexture = new PIXI.Texture("wabbit.png") + wabbitTexture = new PIXI.Texture.fromImage("wabbit.png") counter = document.createElement("div"); counter.className = "counter"; @@ -55,7 +50,6 @@ count = startBunnyCount; counter.innerHTML = count + " BUNNIES"; - container = new PIXI.DisplayObjectContainer(); stage.addChild(container); @@ -114,7 +108,9 @@ minX = 0; maxY = height; minY = 0; - + + detail.style.left = width - 204 + "px"; + detail.style.top = height - 100 + "px"; renderer.resize(width, height); } @@ -126,17 +122,17 @@ { // add 10 at a time :) - for (var i = 0; i < 2; i++) + for (var i = 0; i < 10; i++) { - var bunny = new PIXI.Sprite(wabbitTexture, {x:0, y:0, width:26, height:37}); + var bunny = new PIXI.Sprite(wabbitTexture); bunny.speedX = Math.random() * 10; bunny.speedY = (Math.random() * 10) - 5; bunny.anchor.x = 0.5; bunny.anchor.y = 1; - bunny.alpha = 0.3 + Math.random() * 0.7; + //bunny.alpha = 0.3 + Math.random() * 0.7; bunnys.push(bunny); - bunny.rotation = Math.random() - 0.5; + //bunny.rotation = Math.random() - 0.5; container.addChild(bunny); count++; diff --git a/examples/bunny benchmark/js/pixi.js b/examples/bunny benchmark/js/pixi.js new file mode 100644 index 0000000..65add09 --- /dev/null +++ b/examples/bunny benchmark/js/pixi.js @@ -0,0 +1,110 @@ +var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI=PIXI||{};PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)}; +var k=null;f();var l={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,j){var b=new k(3);b[0]=a;b[1]=d;b[2]=j;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,j){if(!j||a===j)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;j[0]=a[0]+d[0];j[1]=a[1]+d[1];j[2]=a[2]+d[2];return j},subtract:function(a, +d,j){if(!j||a===j)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;j[0]=a[0]-d[0];j[1]=a[1]-d[1];j[2]=a[2]-d[2];return j},multiply:function(a,d,j){if(!j||a===j)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;j[0]=a[0]*d[0];j[1]=a[1]*d[1];j[2]=a[2]*d[2];return j},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,j){if(!j||a===j)return a[0]*=d,a[1]*=d,a[2]*=d,a;j[0]=a[0]*d;j[1]=a[1]*d;j[2]=a[2]*d;return j},normalize:function(a,d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=Math.sqrt(j* +j+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=j,d[1]=b,d[2]=c,d;e=1/e;d[0]=j*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,j){j||(j=a);var b=a[0],c=a[1];a=a[2];var e=d[0],n=d[1];d=d[2];j[0]=c*d-a*n;j[1]=a*e-b*d;j[2]=b*n-c*e;return j},length:function(a){var d=a[0],j=a[1];a=a[2];return Math.sqrt(d*d+j*j+a*a)},squaredLength:function(a){var d=a[0],j=a[1];a=a[2];return d*d+j*j+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,j){j||(j=a);var b= +a[0]-d[0],c=a[1]-d[1];a=a[2]-d[2];d=Math.sqrt(b*b+c*c+a*a);if(!d)return j[0]=0,j[1]=0,j[2]=0,j;d=1/d;j[0]=b*d;j[1]=c*d;j[2]=a*d;return j},lerp:function(a,d,j,b){b||(b=a);b[0]=a[0]+j*(d[0]-a[0]);b[1]=a[1]+j*(d[1]-a[1]);b[2]=a[2]+j*(d[2]-a[2]);return b},dist:function(a,d){var j=d[0]-a[0],b=d[1]-a[1],c=d[2]-a[2];return Math.sqrt(j*j+b*b+c*c)}},p=null,q=new k(4);l.unproject=function(a,d,j,b,c){c||(c=a);p||(p=t.create());var e=p;q[0]=2*(a[0]-b[0])/b[2]-1;q[1]=2*(a[1]-b[1])/b[3]-1;q[2]=2*a[2]-1;q[3]=1; +t.multiply(j,d,e);if(!t.inverse(e))return null;t.multiplyVec4(e,q);if(0===q[3])return null;c[0]=q[0]/q[3];c[1]=q[1]/q[3];c[2]=q[2]/q[3];return c};var C=l.createFrom(1,0,0),F=l.createFrom(0,1,0),u=l.createFrom(0,0,1),w=l.create();l.rotationTo=function(a,d,j){j||(j=m.create());var b=l.dot(a,d);if(1<=b)m.set(H,j);else if(-0.999999>b)l.cross(C,a,w),1E-6>l.length(w)&&l.cross(F,a,w),1E-6>l.length(w)&&l.cross(u,a,w),l.normalize(w),m.fromAngleAxis(Math.PI,w,j);else{var b=Math.sqrt(2*(1+b)),c=1/b;l.cross(a, +d,w);j[0]=w[0]*c;j[1]=w[1]*c;j[2]=w[2]*c;j[3]=0.5*b;m.normalize(j)}1j[3]&&(j[3]=-1);return j};l.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var x={create:function(a){var d=new k(9);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8]):d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=0;return d},createFrom:function(a,d,j,b,c,e,n,f,E){var s=new k(9);s[0]=a;s[1]=d;s[2]=j;s[3]=b;s[4]=c;s[5]=e;s[6]=n;s[7]=f;s[8]=E;return s},determinant:function(a){var d= +a[3],j=a[4],b=a[5],c=a[6],e=a[7],n=a[8];return a[0]*(n*j-b*e)+a[1]*(-n*d+b*c)+a[2]*(e*d-j*c)},inverse:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[3],n=a[4],f=a[5],E=a[6],s=a[7],I=a[8],g=I*n-f*s,h=-I*e+f*E,k=s*e-n*E,r=j*g+b*h+c*k;if(!r)return null;r=1/r;d||(d=x.create());d[0]=g*r;d[1]=(-I*b+c*s)*r;d[2]=(f*b-c*n)*r;d[3]=h*r;d[4]=(I*j-c*E)*r;d[5]=(-f*j+c*e)*r;d[6]=k*r;d[7]=(-s*j+b*E)*r;d[8]=(n*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],D=a[4],E=a[5],s=a[6],I= +a[7];a=a[8];var g=d[0],h=d[1],k=d[2],r=d[3],m=d[4],l=d[5],q=d[6],v=d[7];d=d[8];j[0]=g*b+h*f+k*s;j[1]=g*c+h*D+k*I;j[2]=g*e+h*E+k*a;j[3]=r*b+m*f+l*s;j[4]=r*c+m*D+l*I;j[5]=r*e+m*E+l*a;j[6]=q*b+v*f+d*s;j[7]=q*c+v*D+d*I;j[8]=q*e+v*E+d*a;return j},multiplyVec2:function(a,d,j){j||(j=d);var b=d[0];d=d[1];j[0]=b*a[0]+d*a[3]+a[6];j[1]=b*a[1]+d*a[4]+a[7];return j},multiplyVec3:function(a,d,j){j||(j=d);var b=d[0],c=d[1];d=d[2];j[0]=b*a[0]+c*a[3]+d*a[6];j[1]=b*a[1]+c*a[4]+d*a[7];j[2]=b*a[2]+c*a[5]+d*a[8];return j}, +set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])},identity:function(a){a||(a=x.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, +d){if(!d||a===d){var j=a[1],b=a[2],c=a[5];a[1]=a[3];a[2]=a[6];a[3]=j;a[5]=a[7];a[6]=b;a[7]=c;return a}d[0]=a[0];d[1]=a[3];d[2]=a[6];d[3]=a[1];d[4]=a[4];d[5]=a[7];d[6]=a[2];d[7]=a[5];d[8]=a[8];return d},toMat4:function(a,d){d||(d=t.create());d[15]=1;d[14]=0;d[13]=0;d[12]=0;d[11]=0;d[10]=a[8];d[9]=a[7];d[8]=a[6];d[7]=0;d[6]=a[5];d[5]=a[4];d[4]=a[3];d[3]=0;d[2]=a[2];d[1]=a[1];d[0]=a[0];return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ +a[8]+"]"}},t={create:function(a){var d=new k(16);a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8],d[9]=a[9],d[10]=a[10],d[11]=a[11],d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d},createFrom:function(a,d,j,b,c,e,f,D,E,s,g,h,m,l,r,q){var A=new k(16);A[0]=a;A[1]=d;A[2]=j;A[3]=b;A[4]=c;A[5]=e;A[6]=f;A[7]=D;A[8]=E;A[9]=s;A[10]=g;A[11]=h;A[12]=m;A[13]=l;A[14]=r;A[15]=q;return A},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4]; +d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=a[12];d[13]=a[13];d[14]=a[14];d[15]=a[15];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])&&1E-6>Math.abs(a[9]-d[9])&&1E-6>Math.abs(a[10]-d[10])&&1E-6>Math.abs(a[11]-d[11])&&1E-6>Math.abs(a[12]- +d[12])&&1E-6>Math.abs(a[13]-d[13])&&1E-6>Math.abs(a[14]-d[14])&&1E-6>Math.abs(a[15]-d[15])},identity:function(a){a||(a=t.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,d){if(!d||a===d){var j=a[1],b=a[2],c=a[3],e=a[6],f=a[7],D=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=j;a[6]=a[9];a[7]=a[13];a[8]=b;a[9]=e;a[11]=a[14];a[12]=c;a[13]=f;a[14]=D;return a}d[0]=a[0];d[1]=a[4];d[2]=a[8];d[3]=a[12]; +d[4]=a[1];d[5]=a[5];d[6]=a[9];d[7]=a[13];d[8]=a[2];d[9]=a[6];d[10]=a[10];d[11]=a[14];d[12]=a[3];d[13]=a[7];d[14]=a[11];d[15]=a[15];return d},determinant:function(a){var d=a[0],j=a[1],b=a[2],c=a[3],e=a[4],f=a[5],D=a[6],E=a[7],s=a[8],g=a[9],h=a[10],k=a[11],m=a[12],r=a[13],l=a[14];a=a[15];return m*g*D*c-s*r*D*c-m*f*h*c+e*r*h*c+s*f*l*c-e*g*l*c-m*g*b*E+s*r*b*E+m*j*h*E-d*r*h*E-s*j*l*E+d*g*l*E+m*f*b*k-e*r*b*k-m*j*D*k+d*r*D*k+e*j*l*k-d*f*l*k-s*f*b*a+e*g*b*a+s*j*D*a-d*g*D*a-e*j*h*a+d*f*h*a},inverse:function(a, +d){d||(d=a);var j=a[0],b=a[1],c=a[2],e=a[3],f=a[4],D=a[5],E=a[6],s=a[7],g=a[8],h=a[9],k=a[10],m=a[11],r=a[12],l=a[13],A=a[14],q=a[15],v=j*D-b*f,J=j*E-c*f,y=j*s-e*f,z=b*E-c*D,t=b*s-e*D,u=c*s-e*E,p=g*l-h*r,w=g*A-k*r,x=g*q-m*r,B=h*A-k*l,C=h*q-m*l,F=k*q-m*A,G=v*F-J*C+y*B+z*x-t*w+u*p;if(!G)return null;G=1/G;d[0]=(D*F-E*C+s*B)*G;d[1]=(-b*F+c*C-e*B)*G;d[2]=(l*u-A*t+q*z)*G;d[3]=(-h*u+k*t-m*z)*G;d[4]=(-f*F+E*x-s*w)*G;d[5]=(j*F-c*x+e*w)*G;d[6]=(-r*u+A*y-q*J)*G;d[7]=(g*u-k*y+m*J)*G;d[8]=(f*C-D*x+s*p)*G;d[9]= +(-j*C+b*x-e*p)*G;d[10]=(r*t-l*y+q*v)*G;d[11]=(-g*t+h*y-m*v)*G;d[12]=(-f*B+D*w-E*p)*G;d[13]=(j*B-b*w+c*p)*G;d[14]=(-r*z+l*J-A*v)*G;d[15]=(g*z-h*J+k*v)*G;return d},toRotationMat:function(a,d){d||(d=t.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d},toMat3:function(a,d){d||(d=x.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[4];d[4]=a[5];d[5]=a[6];d[6]=a[8];d[7]=a[9];d[8]=a[10]; +return d},toInverseMat3:function(a,d){var j=a[0],b=a[1],c=a[2],e=a[4],f=a[5],D=a[6],g=a[8],s=a[9],h=a[10],k=h*f-D*s,m=-h*e+D*g,l=s*e-f*g,r=j*k+b*m+c*l;if(!r)return null;r=1/r;d||(d=x.create());d[0]=k*r;d[1]=(-h*b+c*s)*r;d[2]=(D*b-c*f)*r;d[3]=m*r;d[4]=(h*j-c*g)*r;d[5]=(-D*j+c*e)*r;d[6]=l*r;d[7]=(-s*j+b*g)*r;d[8]=(f*j-b*e)*r;return d},multiply:function(a,d,j){j||(j=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4],h=a[5],s=a[6],k=a[7],m=a[8],l=a[9],q=a[10],r=a[11],t=a[12],A=a[13],u=a[14];a=a[15];var v=d[0], +p=d[1],y=d[2],z=d[3];j[0]=v*b+p*g+y*m+z*t;j[1]=v*c+p*h+y*l+z*A;j[2]=v*e+p*s+y*q+z*u;j[3]=v*f+p*k+y*r+z*a;v=d[4];p=d[5];y=d[6];z=d[7];j[4]=v*b+p*g+y*m+z*t;j[5]=v*c+p*h+y*l+z*A;j[6]=v*e+p*s+y*q+z*u;j[7]=v*f+p*k+y*r+z*a;v=d[8];p=d[9];y=d[10];z=d[11];j[8]=v*b+p*g+y*m+z*t;j[9]=v*c+p*h+y*l+z*A;j[10]=v*e+p*s+y*q+z*u;j[11]=v*f+p*k+y*r+z*a;v=d[12];p=d[13];y=d[14];z=d[15];j[12]=v*b+p*g+y*m+z*t;j[13]=v*c+p*h+y*l+z*A;j[14]=v*e+p*s+y*q+z*u;j[15]=v*f+p*k+y*r+z*a;return j},multiplyVec3:function(a,d,b){b||(b=d); +var c=d[0],e=d[1];d=d[2];b[0]=a[0]*c+a[4]*e+a[8]*d+a[12];b[1]=a[1]*c+a[5]*e+a[9]*d+a[13];b[2]=a[2]*c+a[6]*e+a[10]*d+a[14];return b},multiplyVec4:function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=d[3];b[0]=a[0]*c+a[4]*e+a[8]*f+a[12]*d;b[1]=a[1]*c+a[5]*e+a[9]*f+a[13]*d;b[2]=a[2]*c+a[6]*e+a[10]*f+a[14]*d;b[3]=a[3]*c+a[7]*e+a[11]*f+a[15]*d;return b},translate:function(a,d,b){var c=d[0],e=d[1];d=d[2];var f,n,g,h,s,k,m,l,p,r,q,t;if(!b||a===b)return a[12]=a[0]*c+a[4]*e+a[8]*d+a[12],a[13]=a[1]*c+a[5]*e+ +a[9]*d+a[13],a[14]=a[2]*c+a[6]*e+a[10]*d+a[14],a[15]=a[3]*c+a[7]*e+a[11]*d+a[15],a;f=a[0];n=a[1];g=a[2];h=a[3];s=a[4];k=a[5];m=a[6];l=a[7];p=a[8];r=a[9];q=a[10];t=a[11];b[0]=f;b[1]=n;b[2]=g;b[3]=h;b[4]=s;b[5]=k;b[6]=m;b[7]=l;b[8]=p;b[9]=r;b[10]=q;b[11]=t;b[12]=f*c+s*e+p*d+a[12];b[13]=n*c+k*e+r*d+a[13];b[14]=g*c+m*e+q*d+a[14];b[15]=h*c+l*e+t*d+a[15];return b},scale:function(a,d,b){var c=d[0],e=d[1];d=d[2];if(!b||a===b)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=d,a[9]*= +d,a[10]*=d,a[11]*=d,a;b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[7]=a[7]*e;b[8]=a[8]*d;b[9]=a[9]*d;b[10]=a[10]*d;b[11]=a[11]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},rotate:function(a,d,b,c){var e=b[0],f=b[1];b=b[2];var n=Math.sqrt(e*e+f*f+b*b),g,h,k,m,l,p,q,r,t,u,w,v,x,y,z,B,C,F,H,K;if(!n)return null;1!==n&&(n=1/n,e*=n,f*=n,b*=n);g=Math.sin(d);h=Math.cos(d);k=1-h;d=a[0];n=a[1];m=a[2];l=a[3];p=a[4];q=a[5];r=a[6];t=a[7];u=a[8];w=a[9];v= +a[10];x=a[11];y=e*e*k+h;z=f*e*k+b*g;B=b*e*k-f*g;C=e*f*k-b*g;F=f*f*k+h;H=b*f*k+e*g;K=e*b*k+f*g;e=f*b*k-e*g;f=b*b*k+h;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=d*y+p*z+u*B;c[1]=n*y+q*z+w*B;c[2]=m*y+r*z+v*B;c[3]=l*y+t*z+x*B;c[4]=d*C+p*F+u*H;c[5]=n*C+q*F+w*H;c[6]=m*C+r*F+v*H;c[7]=l*C+t*F+x*H;c[8]=d*K+p*e+u*f;c[9]=n*K+q*e+w*f;c[10]=m*K+r*e+v*f;c[11]=l*K+t*e+x*f;return c},rotateX:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[4],f=a[5],n=a[6],g=a[7],h=a[8],k=a[9],m=a[10], +l=a[11];b?a!==b&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[4]=e*d+h*c;b[5]=f*d+k*c;b[6]=n*d+m*c;b[7]=g*d+l*c;b[8]=e*-c+h*d;b[9]=f*-c+k*d;b[10]=n*-c+m*d;b[11]=g*-c+l*d;return b},rotateY:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[8],k=a[9],m=a[10],l=a[11];b?a!==b&&(b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*-c;b[1]=f*d+k*-c;b[2]=n*d+m*-c;b[3]=g* +d+l*-c;b[8]=e*c+h*d;b[9]=f*c+k*d;b[10]=n*c+m*d;b[11]=g*c+l*d;return b},rotateZ:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],n=a[2],g=a[3],h=a[4],k=a[5],m=a[6],l=a[7];b?a!==b&&(b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+h*c;b[1]=f*d+k*c;b[2]=n*d+m*c;b[3]=g*d+l*c;b[4]=e*-c+h*d;b[5]=f*-c+k*d;b[6]=n*-c+m*d;b[7]=g*-c+l*d;return b},frustum:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2*e/g;n[1]=0; +n[2]=0;n[3]=0;n[4]=0;n[5]=2*e/h;n[6]=0;n[7]=0;n[8]=(d+a)/g;n[9]=(c+b)/h;n[10]=-(f+e)/k;n[11]=-1;n[12]=0;n[13]=0;n[14]=-(2*f*e)/k;n[15]=0;return n},perspective:function(a,d,b,c,e){a=b*Math.tan(a*Math.PI/360);d*=a;return t.frustum(-d,d,-a,a,b,c,e)},ortho:function(a,d,b,c,e,f,n){n||(n=t.create());var g=d-a,h=c-b,k=f-e;n[0]=2/g;n[1]=0;n[2]=0;n[3]=0;n[4]=0;n[5]=2/h;n[6]=0;n[7]=0;n[8]=0;n[9]=0;n[10]=-2/k;n[11]=0;n[12]=-(a+d)/g;n[13]=-(c+b)/h;n[14]=-(f+e)/k;n[15]=1;return n},lookAt:function(a,d,b,c){c|| +(c=t.create());var e,f,n,g,h,k,m,l,p=a[0],q=a[1];a=a[2];n=b[0];g=b[1];f=b[2];m=d[0];b=d[1];e=d[2];if(p===m&&q===b&&a===e)return t.identity(c);d=p-m;b=q-b;m=a-e;l=1/Math.sqrt(d*d+b*b+m*m);d*=l;b*=l;m*=l;e=g*m-f*b;f=f*d-n*m;n=n*b-g*d;(l=Math.sqrt(e*e+f*f+n*n))?(l=1/l,e*=l,f*=l,n*=l):n=f=e=0;g=b*n-m*f;h=m*e-d*n;k=d*f-b*e;(l=Math.sqrt(g*g+h*h+k*k))?(l=1/l,g*=l,h*=l,k*=l):k=h=g=0;c[0]=e;c[1]=g;c[2]=d;c[3]=0;c[4]=f;c[5]=h;c[6]=b;c[7]=0;c[8]=n;c[9]=k;c[10]=m;c[11]=0;c[12]=-(e*p+f*q+n*a);c[13]=-(g*p+h*q+ +k*a);c[14]=-(d*p+b*q+m*a);c[15]=1;return c},fromRotationTranslation:function(a,d,b){b||(b=t.create());var c=a[0],e=a[1],f=a[2],n=a[3],g=c+c,h=e+e,k=f+f;a=c*g;var l=c*h,c=c*k,m=e*h,e=e*k,f=f*k,g=n*g,h=n*h,n=n*k;b[0]=1-(m+f);b[1]=l+n;b[2]=c-h;b[3]=0;b[4]=l-n;b[5]=1-(a+f);b[6]=e+g;b[7]=0;b[8]=c+h;b[9]=e-g;b[10]=1-(a+m);b[11]=0;b[12]=d[0];b[13]=d[1];b[14]=d[2];b[15]=1;return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ +a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},m={create:function(a){var d=new k(4);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]):d[0]=d[1]=d[2]=d[3]=0;return d},createFrom:function(a,d,b,c){var e=new k(4);e[0]=a;e[1]=d;e[2]=b;e[3]=c;return e},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])},identity:function(a){a||(a=m.create()); +a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},H=m.identity();m.calculateW=function(a,d){var b=a[0],c=a[1],e=a[2];if(!d||a===d)return a[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e)),a;d[0]=b;d[1]=c;d[2]=e;d[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e));return d};m.dot=function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3]};m.inverse=function(a,d){var b=a[0],c=a[1],e=a[2],f=a[3],b=(b=b*b+c*c+e*e+f*f)?1/b:0;if(!d||a===d)return a[0]*=-b,a[1]*=-b,a[2]*=-b,a[3]*=b,a;d[0]=-a[0]*b;d[1]=-a[1]*b;d[2]=-a[2]*b;d[3]=a[3]*b; +return d};m.conjugate=function(a,d){if(!d||a===d)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=a[3];return d};m.length=function(a){var d=a[0],b=a[1],c=a[2];a=a[3];return Math.sqrt(d*d+b*b+c*c+a*a)};m.normalize=function(a,d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],g=Math.sqrt(b*b+c*c+e*e+f*f);if(0===g)return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d;g=1/g;d[0]=b*g;d[1]=c*g;d[2]=e*g;d[3]=f*g;return d};m.add=function(a,d,b){if(!b||a===b)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a[3]+= +d[3],a;b[0]=a[0]+d[0];b[1]=a[1]+d[1];b[2]=a[2]+d[2];b[3]=a[3]+d[3];return b};m.multiply=function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2];a=a[3];var g=d[0],h=d[1],k=d[2];d=d[3];b[0]=c*d+a*g+e*k-f*h;b[1]=e*d+a*h+f*g-c*k;b[2]=f*d+a*k+c*h-e*g;b[3]=a*d-c*g-e*h-f*k;return b};m.multiplyVec3=function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=a[0];var g=a[1],h=a[2];a=a[3];var k=a*c+g*f-h*e,l=a*e+h*c-d*f,m=a*f+d*e-g*c,c=-d*c-g*e-h*f;b[0]=k*a+c*-d+l*-h-m*-g;b[1]=l*a+c*-g+m*-d-k*-h;b[2]=m*a+c*-h+k*-g-l*-d; +return b};m.scale=function(a,d,b){if(!b||a===b)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a;b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[3]=a[3]*d;return b};m.toMat3=function(a,d){d||(d=x.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b*k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=m-f;d[4]=1-(l+e);d[5]=c+g;d[6]=b+h;d[7]=c-g;d[8]=1-(l+p);return d};m.toMat4=function(a,d){d||(d=t.create());var b=a[0],c=a[1],e=a[2],f=a[3],g=b+b,h=c+c,k=e+e,l=b*g,m=b*h,b=b* +k,p=c*h,c=c*k,e=e*k,g=f*g,h=f*h,f=f*k;d[0]=1-(p+e);d[1]=m+f;d[2]=b-h;d[3]=0;d[4]=m-f;d[5]=1-(l+e);d[6]=c+g;d[7]=0;d[8]=b+h;d[9]=c-g;d[10]=1-(l+p);d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d};m.slerp=function(a,d,b,c){c||(c=a);var e=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3],f,g;if(1<=Math.abs(e))return c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]),c;f=Math.acos(e);g=Math.sqrt(1-e*e);if(0.0010>Math.abs(g))return c[0]=0.5*a[0]+0.5*d[0],c[1]=0.5*a[1]+0.5*d[1],c[2]=0.5*a[2]+0.5*d[2],c[3]=0.5*a[3]+ +0.5*d[3],c;e=Math.sin((1-b)*f)/g;b=Math.sin(b*f)/g;c[0]=a[0]*e+d[0]*b;c[1]=a[1]*e+d[1]*b;c[2]=a[2]*e+d[2]*b;c[3]=a[3]*e+d[3]*b;return c};m.fromRotationMatrix=function(a,d){d||(d=m.create());var b=a[0]+a[4]+a[8],c;if(0a[0]&&(b=1);a[8]>a[3*b+b]&&(b=2);var e=c[b],f=c[e];c=Math.sqrt(a[3*b+b]-a[3*e+e]-a[3*f+f]+1);d[b]=0.5*c;c= +0.5/c;d[3]=(a[3*f+e]-a[3*e+f])*c;d[e]=(a[3*e+b]+a[3*b+e])*c;d[f]=(a[3*f+b]+a[3*b+f])*c}return d};x.toQuat4=m.fromRotationMatrix;var B=x.create();m.fromAxes=function(a,d,b,c){B[0]=d[0];B[3]=d[1];B[6]=d[2];B[1]=b[0];B[4]=b[1];B[7]=b[2];B[2]=a[0];B[5]=a[1];B[8]=a[2];return m.fromRotationMatrix(B,c)};m.identity=function(a){a||(a=m.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};m.fromAngleAxis=function(a,d,b){b||(b=m.create());a*=0.5;var c=Math.sin(a);b[3]=Math.cos(a);b[0]=c*d[0];b[1]=c*d[1];b[2]=c*d[2]; +return b};m.toAngleAxis=function(a,d){d||(d=a);var b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); +b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 +Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],e=a[1],f=a[2],g=a[3],h=c*g-f*e;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-e*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, +b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];c[0]=e*b[0]+f*b[2];c[1]=e*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=e*b+f*h;c[1]=e*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var e=b[0];b=b[1];c[0]=e*a[0]+b*a[1];c[1]=e*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var e=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=e*b;c[2]=f*h;c[3]= +g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, +b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| +(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType= +f,b.glMath=e,b.vec2=M,b.vec3=l,b.vec4=N,b.mat2=L,b.mat3=x,b.mat4=t,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:M,vec3:l,vec4:N,mat2:L,mat3:x,mat4:t,quat4:m}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"]; +PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"]; +PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;eb.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;gb.length)){var c=this.verticies,f=b[0],e,g=e=0,h=b[0];this.count-=0.2;c[0]=h.x+e;c[1]=h.y+g;c[2]=h.x-e;c[3]=h.y-g;for(var k=b.length,l=1;l>1);var b=m[0];return b*(1.5-0.5*a*b*b)}}else g.invsqrt=function(a){return 1/Math.sqrt(a)}; -var l=null;f();var j={create:function(a){var b=new l(3);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0;return b},createFrom:function(a,b,e){var c=new l(3);c[0]=a;c[1]=b;c[2]=e;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])},add:function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];return e},subtract:function(a, -b,e){if(!e||a===e)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];return e},multiply:function(a,b,e){if(!e||a===e)return a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a;e[0]=a[0]*b[0];e[1]=a[1]*b[1];e[2]=a[2]*b[2];return e},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;return e},normalize:function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=Math.sqrt(e* -e+c*c+d*d);if(!k)return b[0]=0,b[1]=0,b[2]=0,b;if(1===k)return b[0]=e,b[1]=c,b[2]=d,b;k=1/k;b[0]=e*k;b[1]=c*k;b[2]=d*k;return b},cross:function(a,b,e){e||(e=a);var c=a[0],d=a[1];a=a[2];var k=b[0],h=b[1];b=b[2];e[0]=d*b-a*h;e[1]=a*k-c*b;e[2]=c*h-d*k;return e},length:function(a){var b=a[0],e=a[1];a=a[2];return Math.sqrt(b*b+e*e+a*a)},squaredLength:function(a){var b=a[0],e=a[1];a=a[2];return b*b+e*e+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,b,e){e||(e=a);var c= -a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];b=Math.sqrt(c*c+d*d+a*a);if(!b)return e[0]=0,e[1]=0,e[2]=0,e;b=1/b;e[0]=c*b;e[1]=d*b;e[2]=a*b;return e},lerp:function(a,b,e,c){c||(c=a);c[0]=a[0]+e*(b[0]-a[0]);c[1]=a[1]+e*(b[1]-a[1]);c[2]=a[2]+e*(b[2]-a[2]);return c},dist:function(a,b){var e=b[0]-a[0],c=b[1]-a[1],d=b[2]-a[2];return Math.sqrt(e*e+c*c+d*d)}},x=null,n=new l(4);j.unproject=function(a,b,e,c,d){d||(d=a);x||(x=y.create());var k=x;n[0]=2*(a[0]-c[0])/c[2]-1;n[1]=2*(a[1]-c[1])/c[3]-1;n[2]=2*a[2]-1;n[3]=1; -y.multiply(e,b,k);if(!y.inverse(k))return null;y.multiplyVec4(k,n);if(0===n[3])return null;d[0]=n[0]/n[3];d[1]=n[1]/n[3];d[2]=n[2]/n[3];return d};var z=j.createFrom(1,0,0),A=j.createFrom(0,1,0),H=j.createFrom(0,0,1),C=j.create();j.rotationTo=function(a,b,e){e||(e=s.create());var c=j.dot(a,b);if(1<=c)s.set(O,e);else if(-0.999999>c)j.cross(z,a,C),1E-6>j.length(C)&&j.cross(A,a,C),1E-6>j.length(C)&&j.cross(H,a,C),j.normalize(C),s.fromAngleAxis(Math.PI,C,e);else{var c=Math.sqrt(2*(1+c)),d=1/c;j.cross(a, -b,C);e[0]=C[0]*d;e[1]=C[1]*d;e[2]=C[2]*d;e[3]=0.5*c;s.normalize(e)}1e[3]&&(e[3]=-1);return e};j.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var F={create:function(a){var b=new l(9);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0;return b},createFrom:function(a,b,e,c,d,k,h,E,K){var q=new l(9);q[0]=a;q[1]=b;q[2]=e;q[3]=c;q[4]=d;q[5]=k;q[6]=h;q[7]=E;q[8]=K;return q},determinant:function(a){var b= -a[3],e=a[4],c=a[5],d=a[6],k=a[7],h=a[8];return a[0]*(h*e-c*k)+a[1]*(-h*b+c*d)+a[2]*(k*b-e*d)},inverse:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],E=a[5],K=a[6],q=a[7],f=a[8],g=f*h-E*q,j=-f*k+E*K,J=q*k-h*K,r=e*g+c*j+d*J;if(!r)return null;r=1/r;b||(b=F.create());b[0]=g*r;b[1]=(-f*c+d*q)*r;b[2]=(E*c-d*h)*r;b[3]=j*r;b[4]=(f*e-d*K)*r;b[5]=(-E*e+d*k)*r;b[6]=J*r;b[7]=(-q*e+c*K)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],E=a[4],f=a[5],q=a[6],g= -a[7];a=a[8];var u=b[0],j=b[1],J=b[2],r=b[3],l=b[4],t=b[5],m=b[6],p=b[7];b=b[8];e[0]=u*c+j*h+J*q;e[1]=u*d+j*E+J*g;e[2]=u*k+j*f+J*a;e[3]=r*c+l*h+t*q;e[4]=r*d+l*E+t*g;e[5]=r*k+l*f+t*a;e[6]=m*c+p*h+b*q;e[7]=m*d+p*E+b*g;e[8]=m*k+p*f+b*a;return e},multiplyVec2:function(a,b,e){e||(e=b);var c=b[0];b=b[1];e[0]=c*a[0]+b*a[3]+a[6];e[1]=c*a[1]+b*a[4]+a[7];return e},multiplyVec3:function(a,b,e){e||(e=b);var c=b[0],d=b[1];b=b[2];e[0]=c*a[0]+d*a[3]+b*a[6];e[1]=c*a[1]+d*a[4]+b*a[7];e[2]=c*a[2]+d*a[5]+b*a[8];return e}, -set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])},identity:function(a){a||(a=F.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a, -b){if(!b||a===b){var e=a[1],c=a[2],d=a[5];a[1]=a[3];a[2]=a[6];a[3]=e;a[5]=a[7];a[6]=c;a[7]=d;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]=a[8];return b},toMat4:function(a,b){b||(b=y.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+ -a[8]+"]"}},y={create:function(a){var b=new l(16);a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]);return b},createFrom:function(a,b,e,c,d,k,h,E,f,q,g,u,j,J,r,m){var t=new l(16);t[0]=a;t[1]=b;t[2]=e;t[3]=c;t[4]=d;t[5]=k;t[6]=h;t[7]=E;t[8]=f;t[9]=q;t[10]=g;t[11]=u;t[12]=j;t[13]=J;t[14]=r;t[15]=m;return t},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4]; -b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])&&1E-6>Math.abs(a[4]-b[4])&&1E-6>Math.abs(a[5]-b[5])&&1E-6>Math.abs(a[6]-b[6])&&1E-6>Math.abs(a[7]-b[7])&&1E-6>Math.abs(a[8]-b[8])&&1E-6>Math.abs(a[9]-b[9])&&1E-6>Math.abs(a[10]-b[10])&&1E-6>Math.abs(a[11]-b[11])&&1E-6>Math.abs(a[12]- -b[12])&&1E-6>Math.abs(a[13]-b[13])&&1E-6>Math.abs(a[14]-b[14])&&1E-6>Math.abs(a[15]-b[15])},identity:function(a){a||(a=y.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){var e=a[1],c=a[2],d=a[3],k=a[6],h=a[7],E=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=e;a[6]=a[9];a[7]=a[13];a[8]=c;a[9]=k;a[11]=a[14];a[12]=d;a[13]=h;a[14]=E;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12]; -b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b=a[0],e=a[1],c=a[2],d=a[3],k=a[4],h=a[5],E=a[6],f=a[7],g=a[8],I=a[9],u=a[10],j=a[11],l=a[12],r=a[13],m=a[14];a=a[15];return l*I*E*d-g*r*E*d-l*h*u*d+k*r*u*d+g*h*m*d-k*I*m*d-l*I*c*f+g*r*c*f+l*e*u*f-b*r*u*f-g*e*m*f+b*I*m*f+l*h*c*j-k*r*c*j-l*e*E*j+b*r*E*j+k*e*m*j-b*h*m*j-g*h*c*a+k*I*c*a+g*e*E*a-b*I*E*a-k*e*u*a+b*h*u*a},inverse:function(a, -b){b||(b=a);var e=a[0],c=a[1],d=a[2],k=a[3],h=a[4],f=a[5],g=a[6],q=a[7],I=a[8],u=a[9],j=a[10],l=a[11],r=a[12],m=a[13],t=a[14],p=a[15],s=e*f-c*h,n=e*g-d*h,v=e*q-k*h,w=c*g-d*f,x=c*q-k*f,y=d*q-k*g,z=I*m-u*r,A=I*t-j*r,C=I*p-l*r,D=u*t-j*m,F=u*p-l*m,H=j*p-l*t,G=s*H-n*F+v*D+w*C-x*A+y*z;if(!G)return null;G=1/G;b[0]=(f*H-g*F+q*D)*G;b[1]=(-c*H+d*F-k*D)*G;b[2]=(m*y-t*x+p*w)*G;b[3]=(-u*y+j*x-l*w)*G;b[4]=(-h*H+g*C-q*A)*G;b[5]=(e*H-d*C+k*A)*G;b[6]=(-r*y+t*v-p*n)*G;b[7]=(I*y-j*v+l*n)*G;b[8]=(h*F-f*C+q*z)*G;b[9]= -(-e*F+c*C-k*z)*G;b[10]=(r*x-m*v+p*s)*G;b[11]=(-I*x+u*v-l*s)*G;b[12]=(-h*D+f*A-g*z)*G;b[13]=(e*D-c*A+d*z)*G;b[14]=(-r*w+m*n-t*s)*G;b[15]=(I*w-u*n+j*s)*G;return b},toRotationMat:function(a,b){b||(b=y.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=F.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10]; -return b},toInverseMat3:function(a,b){var e=a[0],c=a[1],d=a[2],k=a[4],h=a[5],f=a[6],g=a[8],q=a[9],j=a[10],u=j*h-f*q,l=-j*k+f*g,m=q*k-h*g,r=e*u+c*l+d*m;if(!r)return null;r=1/r;b||(b=F.create());b[0]=u*r;b[1]=(-j*c+d*q)*r;b[2]=(f*c-d*h)*r;b[3]=l*r;b[4]=(j*e-d*g)*r;b[5]=(-f*e+d*k)*r;b[6]=m*r;b[7]=(-q*e+c*g)*r;b[8]=(h*e-c*k)*r;return b},multiply:function(a,b,e){e||(e=a);var c=a[0],d=a[1],k=a[2],h=a[3],f=a[4],g=a[5],q=a[6],j=a[7],u=a[8],l=a[9],m=a[10],r=a[11],p=a[12],t=a[13],s=a[14];a=a[15];var n=b[0], -B=b[1],v=b[2],w=b[3];e[0]=n*c+B*f+v*u+w*p;e[1]=n*d+B*g+v*l+w*t;e[2]=n*k+B*q+v*m+w*s;e[3]=n*h+B*j+v*r+w*a;n=b[4];B=b[5];v=b[6];w=b[7];e[4]=n*c+B*f+v*u+w*p;e[5]=n*d+B*g+v*l+w*t;e[6]=n*k+B*q+v*m+w*s;e[7]=n*h+B*j+v*r+w*a;n=b[8];B=b[9];v=b[10];w=b[11];e[8]=n*c+B*f+v*u+w*p;e[9]=n*d+B*g+v*l+w*t;e[10]=n*k+B*q+v*m+w*s;e[11]=n*h+B*j+v*r+w*a;n=b[12];B=b[13];v=b[14];w=b[15];e[12]=n*c+B*f+v*u+w*p;e[13]=n*d+B*g+v*l+w*t;e[14]=n*k+B*q+v*m+w*s;e[15]=n*h+B*j+v*r+w*a;return e},multiplyVec3:function(a,b,e){e||(e=b); -var c=b[0],d=b[1];b=b[2];e[0]=a[0]*c+a[4]*d+a[8]*b+a[12];e[1]=a[1]*c+a[5]*d+a[9]*b+a[13];e[2]=a[2]*c+a[6]*d+a[10]*b+a[14];return e},multiplyVec4:function(a,b,e){e||(e=b);var c=b[0],d=b[1],k=b[2];b=b[3];e[0]=a[0]*c+a[4]*d+a[8]*k+a[12]*b;e[1]=a[1]*c+a[5]*d+a[9]*k+a[13]*b;e[2]=a[2]*c+a[6]*d+a[10]*k+a[14]*b;e[3]=a[3]*c+a[7]*d+a[11]*k+a[15]*b;return e},translate:function(a,b,e){var c=b[0],d=b[1];b=b[2];var k,h,f,g,q,j,u,l,m,n,p,s;if(!e||a===e)return a[12]=a[0]*c+a[4]*d+a[8]*b+a[12],a[13]=a[1]*c+a[5]*d+ -a[9]*b+a[13],a[14]=a[2]*c+a[6]*d+a[10]*b+a[14],a[15]=a[3]*c+a[7]*d+a[11]*b+a[15],a;k=a[0];h=a[1];f=a[2];g=a[3];q=a[4];j=a[5];u=a[6];l=a[7];m=a[8];n=a[9];p=a[10];s=a[11];e[0]=k;e[1]=h;e[2]=f;e[3]=g;e[4]=q;e[5]=j;e[6]=u;e[7]=l;e[8]=m;e[9]=n;e[10]=p;e[11]=s;e[12]=k*c+q*d+m*b+a[12];e[13]=h*c+j*d+n*b+a[13];e[14]=f*c+u*d+p*b+a[14];e[15]=g*c+l*d+s*b+a[15];return e},scale:function(a,b,e){var c=b[0],d=b[1];b=b[2];if(!e||a===e)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=d,a[5]*=d,a[6]*=d,a[7]*=d,a[8]*=b,a[9]*= -b,a[10]*=b,a[11]*=b,a;e[0]=a[0]*c;e[1]=a[1]*c;e[2]=a[2]*c;e[3]=a[3]*c;e[4]=a[4]*d;e[5]=a[5]*d;e[6]=a[6]*d;e[7]=a[7]*d;e[8]=a[8]*b;e[9]=a[9]*b;e[10]=a[10]*b;e[11]=a[11]*b;e[12]=a[12];e[13]=a[13];e[14]=a[14];e[15]=a[15];return e},rotate:function(a,b,e,c){var d=e[0],k=e[1];e=e[2];var h=Math.sqrt(d*d+k*k+e*e),f,g,q,j,l,m,n,r,p,s,x,y,B,v,w,z,A,C,D,F;if(!h)return null;1!==h&&(h=1/h,d*=h,k*=h,e*=h);f=Math.sin(b);g=Math.cos(b);q=1-g;b=a[0];h=a[1];j=a[2];l=a[3];m=a[4];n=a[5];r=a[6];p=a[7];s=a[8];x=a[9];y= -a[10];B=a[11];v=d*d*q+g;w=k*d*q+e*f;z=e*d*q-k*f;A=d*k*q-e*f;C=k*k*q+g;D=e*k*q+d*f;F=d*e*q+k*f;d=k*e*q-d*f;k=e*e*q+g;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=b*v+m*w+s*z;c[1]=h*v+n*w+x*z;c[2]=j*v+r*w+y*z;c[3]=l*v+p*w+B*z;c[4]=b*A+m*C+s*D;c[5]=h*A+n*C+x*D;c[6]=j*A+r*C+y*D;c[7]=l*A+p*C+B*D;c[8]=b*F+m*d+s*k;c[9]=h*F+n*d+x*k;c[10]=j*F+r*d+y*k;c[11]=l*F+p*d+B*k;return c},rotateX:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[4],k=a[5],h=a[6],f=a[7],g=a[8],q=a[9],j=a[10], -l=a[11];e?a!==e&&(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[4]=d*b+g*c;e[5]=k*b+q*c;e[6]=h*b+j*c;e[7]=f*b+l*c;e[8]=d*-c+g*b;e[9]=k*-c+q*b;e[10]=h*-c+j*b;e[11]=f*-c+l*b;return e},rotateY:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[8],j=a[9],l=a[10],m=a[11];e?a!==e&&(e[4]=a[4],e[5]=a[5],e[6]=a[6],e[7]=a[7],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*-c;e[1]=k*b+j*-c;e[2]=h*b+l*-c;e[3]=f* -b+m*-c;e[8]=d*c+g*b;e[9]=k*c+j*b;e[10]=h*c+l*b;e[11]=f*c+m*b;return e},rotateZ:function(a,b,e){var c=Math.sin(b);b=Math.cos(b);var d=a[0],k=a[1],h=a[2],f=a[3],g=a[4],j=a[5],l=a[6],m=a[7];e?a!==e&&(e[8]=a[8],e[9]=a[9],e[10]=a[10],e[11]=a[11],e[12]=a[12],e[13]=a[13],e[14]=a[14],e[15]=a[15]):e=a;e[0]=d*b+g*c;e[1]=k*b+j*c;e[2]=h*b+l*c;e[3]=f*b+m*c;e[4]=d*-c+g*b;e[5]=k*-c+j*b;e[6]=h*-c+l*b;e[7]=f*-c+m*b;return e},frustum:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2*d/f;h[1]=0; -h[2]=0;h[3]=0;h[4]=0;h[5]=2*d/g;h[6]=0;h[7]=0;h[8]=(b+a)/f;h[9]=(c+e)/g;h[10]=-(k+d)/j;h[11]=-1;h[12]=0;h[13]=0;h[14]=-(2*k*d)/j;h[15]=0;return h},perspective:function(a,b,e,c,d){a=e*Math.tan(a*Math.PI/360);b*=a;return y.frustum(-b,b,-a,a,e,c,d)},ortho:function(a,b,e,c,d,k,h){h||(h=y.create());var f=b-a,g=c-e,j=k-d;h[0]=2/f;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/g;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/j;h[11]=0;h[12]=-(a+b)/f;h[13]=-(c+e)/g;h[14]=-(k+d)/j;h[15]=1;return h},lookAt:function(a,b,e,c){c|| -(c=y.create());var d,k,h,f,g,j,l,m,n=a[0],p=a[1];a=a[2];h=e[0];f=e[1];k=e[2];l=b[0];e=b[1];d=b[2];if(n===l&&p===e&&a===d)return y.identity(c);b=n-l;e=p-e;l=a-d;m=1/Math.sqrt(b*b+e*e+l*l);b*=m;e*=m;l*=m;d=f*l-k*e;k=k*b-h*l;h=h*e-f*b;(m=Math.sqrt(d*d+k*k+h*h))?(m=1/m,d*=m,k*=m,h*=m):h=k=d=0;f=e*h-l*k;g=l*d-b*h;j=b*k-e*d;(m=Math.sqrt(f*f+g*g+j*j))?(m=1/m,f*=m,g*=m,j*=m):j=g=f=0;c[0]=d;c[1]=f;c[2]=b;c[3]=0;c[4]=k;c[5]=g;c[6]=e;c[7]=0;c[8]=h;c[9]=j;c[10]=l;c[11]=0;c[12]=-(d*n+k*p+h*a);c[13]=-(f*n+g*p+ -j*a);c[14]=-(b*n+e*p+l*a);c[15]=1;return c},fromRotationTranslation:function(a,b,e){e||(e=y.create());var c=a[0],d=a[1],k=a[2],h=a[3],f=c+c,g=d+d,j=k+k;a=c*f;var l=c*g,c=c*j,m=d*g,d=d*j,k=k*j,f=h*f,g=h*g,h=h*j;e[0]=1-(m+k);e[1]=l+h;e[2]=c-g;e[3]=0;e[4]=l-h;e[5]=1-(a+k);e[6]=d+f;e[7]=0;e[8]=c+g;e[9]=d-f;e[10]=1-(a+m);e[11]=0;e[12]=b[0];e[13]=b[1];e[14]=b[2];e[15]=1;return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+ -a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},s={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,e,c){var d=new l(4);d[0]=a;d[1]=b;d[2]=e;d[3]=c;return d},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=s.create()); -a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},O=s.identity();s.calculateW=function(a,b){var e=a[0],c=a[1],d=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d)),a;b[0]=e;b[1]=c;b[2]=d;b[3]=-Math.sqrt(Math.abs(1-e*e-c*c-d*d));return b};s.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};s.inverse=function(a,b){var e=a[0],c=a[1],d=a[2],f=a[3],e=(e=e*e+c*c+d*d+f*f)?1/e:0;if(!b||a===b)return a[0]*=-e,a[1]*=-e,a[2]*=-e,a[3]*=e,a;b[0]=-a[0]*e;b[1]=-a[1]*e;b[2]=-a[2]*e;b[3]=a[3]*e; -return b};s.conjugate=function(a,b){if(!b||a===b)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};s.length=function(a){var b=a[0],e=a[1],c=a[2];a=a[3];return Math.sqrt(b*b+e*e+c*c+a*a)};s.normalize=function(a,b){b||(b=a);var e=a[0],c=a[1],d=a[2],f=a[3],h=Math.sqrt(e*e+c*c+d*d+f*f);if(0===h)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;h=1/h;b[0]=e*h;b[1]=c*h;b[2]=d*h;b[3]=f*h;return b};s.add=function(a,b,e){if(!e||a===e)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+= -b[3],a;e[0]=a[0]+b[0];e[1]=a[1]+b[1];e[2]=a[2]+b[2];e[3]=a[3]+b[3];return e};s.multiply=function(a,b,e){e||(e=a);var c=a[0],d=a[1],f=a[2];a=a[3];var h=b[0],g=b[1],j=b[2];b=b[3];e[0]=c*b+a*h+d*j-f*g;e[1]=d*b+a*g+f*h-c*j;e[2]=f*b+a*j+c*g-d*h;e[3]=a*b-c*h-d*g-f*j;return e};s.multiplyVec3=function(a,b,e){e||(e=b);var c=b[0],d=b[1],f=b[2];b=a[0];var h=a[1],g=a[2];a=a[3];var j=a*c+h*f-g*d,l=a*d+g*c-b*f,m=a*f+b*d-h*c,c=-b*c-h*d-g*f;e[0]=j*a+c*-b+l*-g-m*-h;e[1]=l*a+c*-h+m*-b-j*-g;e[2]=m*a+c*-g+j*-h-l*-b; -return e};s.scale=function(a,b,e){if(!e||a===e)return a[0]*=b,a[1]*=b,a[2]*=b,a[3]*=b,a;e[0]=a[0]*b;e[1]=a[1]*b;e[2]=a[2]*b;e[3]=a[3]*b;return e};s.toMat3=function(a,b){b||(b=F.create());var e=a[0],c=a[1],d=a[2],f=a[3],h=e+e,g=c+c,j=d+d,l=e*h,m=e*g,e=e*j,n=c*g,c=c*j,d=d*j,h=f*h,g=f*g,f=f*j;b[0]=1-(n+d);b[1]=m+f;b[2]=e-g;b[3]=m-f;b[4]=1-(l+d);b[5]=c+h;b[6]=e+g;b[7]=c-h;b[8]=1-(l+n);return b};s.toMat4=function(a,b){b||(b=y.create());var e=a[0],c=a[1],d=a[2],f=a[3],g=e+e,j=c+c,l=d+d,m=e*g,n=e*j,e=e* -l,p=c*j,c=c*l,d=d*l,g=f*g,j=f*j,f=f*l;b[0]=1-(p+d);b[1]=n+f;b[2]=e-j;b[3]=0;b[4]=n-f;b[5]=1-(m+d);b[6]=c+g;b[7]=0;b[8]=e+j;b[9]=c-g;b[10]=1-(m+p);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};s.slerp=function(a,b,c,d){d||(d=a);var f=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],g,h;if(1<=Math.abs(f))return d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d;g=Math.acos(f);h=Math.sqrt(1-f*f);if(0.001>Math.abs(h))return d[0]=0.5*a[0]+0.5*b[0],d[1]=0.5*a[1]+0.5*b[1],d[2]=0.5*a[2]+0.5*b[2],d[3]=0.5*a[3]+ -0.5*b[3],d;f=Math.sin((1-c)*g)/h;c=Math.sin(c*g)/h;d[0]=a[0]*f+b[0]*c;d[1]=a[1]*f+b[1]*c;d[2]=a[2]*f+b[2]*c;d[3]=a[3]*f+b[3]*c;return d};s.fromRotationMatrix=function(a,b){b||(b=s.create());var c=a[0]+a[4]+a[8],d;if(0a[0]&&(c=1);a[8]>a[3*c+c]&&(c=2);var f=d[c],g=d[f];d=Math.sqrt(a[3*c+c]-a[3*f+f]-a[3*g+g]+1);b[c]=0.5*d;d= -0.5/d;b[3]=(a[3*g+f]-a[3*f+g])*d;b[f]=(a[3*f+c]+a[3*c+f])*d;b[g]=(a[3*g+c]+a[3*c+g])*d}return b};F.toQuat4=s.fromRotationMatrix;var D=F.create();s.fromAxes=function(a,b,c,d){D[0]=b[0];D[3]=b[1];D[6]=b[2];D[1]=c[0];D[4]=c[1];D[7]=c[2];D[2]=a[0];D[5]=a[1];D[8]=a[2];return s.fromRotationMatrix(D,d)};s.identity=function(a){a||(a=s.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};s.fromAngleAxis=function(a,b,c){c||(c=s.create());a*=0.5;var d=Math.sin(a);c[3]=Math.cos(a);c[0]=d*b[0];c[1]=d*b[1];c[2]=d*b[2]; -return c};s.toAngleAxis=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a); -b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0 -Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=L.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],f=a[2],g=a[3],h=c*g-f*d;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-d*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a, -b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];c[0]=d*b[0]+f*b[2];c[1]=d*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var d=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=d*b+f*h;c[1]=d*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var d=b[0];b=b[1];c[0]=d*a[0]+b*a[1];c[1]=d*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var d=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=d*b;c[2]=f*h;c[3]= -g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},N={create:function(a){var b=new l(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,d){var f=new l(4);f[0]=a;f[1]=b;f[2]=c;f[3]=d;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a, -b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b|| -(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)},squaredLength:function(a){var b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};c&&(c.glMatrixArrayType=l,c.MatrixArray=l,c.setMatrixArrayType=d,c.determineMatrixArrayType= -f,c.glMath=g,c.vec2=M,c.vec3=j,c.vec4=N,c.mat2=L,c.mat3=F,c.mat4=y,c.quat4=s);return{glMatrixArrayType:l,MatrixArray:l,setMatrixArrayType:d,determineMatrixArrayType:f,glMath:g,vec2:M,vec3:j,vec4:N,mat2:L,mat3:F,mat4:y,quat4:s}});PIXI=PIXI||{};PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor = gl_FragColor * vColor;","}"]; -PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position = uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord = aTextureCoord;","vColor = aColor;","}"]; -PIXI.CompileVertexShader=function(c,d){for(var f="",g=0;g 0) { - this.checkVisibility(child); + this.checkVisibility(child, actualVisibility); } + + }; } -/** - * @private - */ -PIXI.WebGLRenderer.prototype.setGLVisible = function(displayObject, visibility) -{ - var children = displayObject.children; - - for (var i=0; i < children.length; i++) - { - var child = children[i]; - - if(visibility) - { - this.addDisplayObject(child); - } - else - { - this.removeDisplayObject(child); - } - - if(child.children.length > 0) - { - this.setGLVisible(child, visibility); - } - } - -} - /** * Renders the stage to its webGL view - * @param the PIXI.Stage element to be rendered + * @method render + * @param stage {Stage} the PIXI.Stage element to be rendered */ PIXI.WebGLRenderer.prototype.render = function(stage) { @@ -185,9 +164,18 @@ // update children if need be // best to remove first! - for (var i=0; i < stage.__childrenRemoved.length; i++) this.removeDisplayObject(stage.__childrenRemoved[i]); + for (var i=0; i < stage.__childrenRemoved.length; i++) + { + this.removeDisplayObject(stage.__childrenRemoved[i]); + // stage.__childrenRemoved[i].cacheVisible = false; + } + /* // no add all new sprites - for (var i=0; i < stage.__childrenAdded.length; i++) this.addDisplayObject(stage.__childrenAdded[i]); + for (var i=0; i < stage.__childrenAdded.length; i++) + { + stage.__childrenAdded[i].cacheVisible = false; +// this.addDisplayObject(stage.__childrenAdded[i]); + }*/ // update any textures for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]); @@ -197,7 +185,7 @@ PIXI.texturesToUpdate = []; // recursivly loop through all items! - this.checkVisibility(stage); + this.checkVisibility(stage, true); // update the scen graph stage.updateTransform(); @@ -206,7 +194,7 @@ gl.clear(gl.COLOR_BUFFER_BIT) - gl.clearColor(1, 1, 1, 1.0); + gl.clearColor(0, 0, 0, 1.0); // set the correct blend mode! gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); @@ -265,12 +253,16 @@ */ PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject) { - if(!displayObject.stage)return; - displayObject.cacheVisible = displayObject.visible; + if(!displayObject.stage)return; // means it was removed + if(displayObject.__inWebGL)return; //means it is already in webgL - if(!displayObject.visible)return; + //displayObject.cacheVisible = displayObject.visible; + + // TODO if objects parent is not visible then dont add to stage!!!! + //if(!displayObject.visible)return; + displayObject.batch = null; //displayObject.cacheVisible = true; @@ -458,10 +450,12 @@ PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject) { //if(displayObject.stage)return; - displayObject.cacheVisible = displayObject.visible; + displayObject.cacheVisible = false;//displayObject.visible; if(!displayObject.renderable)return; + displayObject.__inWebGL = false; + /* * removing is a lot quicker.. * @@ -472,9 +466,11 @@ { // should always have a batch! var batch = displayObject.batch; - if(!batch)return; // thismeans the display list has been altered befre rendering + if(!batch)return; // this means the display list has been altered befre rendering batch.remove(displayObject); + + if(batch.size==0) { batchToRemove = batch @@ -528,8 +524,9 @@ /** * resizes the webGL view to the specified width and height - * @param the new width of the webGL view - * @param the new height of the webGL view + * @method resize + * @param width {Number} the new width of the webGL view + * @param height {Number} the new height of the webGL view */ PIXI.WebGLRenderer.prototype.resize = function(width, height) { diff --git a/src/pixi/renderers/WebGLShaders.js b/src/pixi/renderers/WebGLShaders.js index 8a109dc..b717256 100644 --- a/src/pixi/renderers/WebGLShaders.js +++ b/src/pixi/renderers/WebGLShaders.js @@ -2,7 +2,6 @@ /** * @author Mat Groves http://matgroves.com/ */ -var PIXI = PIXI || {}; PIXI.shaderFragmentSrc = [ "precision mediump float;", "varying vec2 vTextureCoord;", diff --git a/src/pixi/textures/BaseTexture.js b/src/pixi/textures/BaseTexture.js index 0d2221d..a3fdce7 100644 --- a/src/pixi/textures/BaseTexture.js +++ b/src/pixi/textures/BaseTexture.js @@ -1,17 +1,16 @@ /** * @author Mat Groves http://matgroves.com/ */ -var PIXI = PIXI || {}; PIXI.BaseTextureCache = {}; PIXI.texturesToUpdate = []; /** - * @class A texture stores the information that represents an image. All textures have a base texture - * @augments PIXI.EventTarget + * A texture stores the information that represents an image. All textures have a base texture + * @class BaseTexture + * @extends EventTarget * @constructor - * @param image url - * @return A new BaseTexture + * @param imageUrl {String} image url */ PIXI.BaseTexture = function(imageUrl) { @@ -19,13 +18,15 @@ /** * The url of the texture - * @type #BaseTexture + * @property imageUrl + * @type String */ this.imageUrl = imageUrl; /** * The html image that is loaded to create the texture - * @type #BaseTexture + * @property image + * @type Image */ this.image = new Image(); @@ -41,17 +42,19 @@ scope.dispatchEvent( { type: 'loaded', content: scope } ); } - $.proxy(this.onImageLoaded, this); + $.proxy(this.onImageLoaded, this); this.image.src = imageUrl; /** * [read only] The width of the base texture set when the image has loaded - * @type #BaseTexture + * @property width + * @type Number */ this.width = 100; /** * [read only] The height of the base texture set when the image has loaded - * @type #BaseTexture + * @property height + * @type Number */ this.height = 100; diff --git a/src/pixi/textures/Texture.js b/src/pixi/textures/Texture.js index e46fd9f..3f6457a 100644 --- a/src/pixi/textures/Texture.js +++ b/src/pixi/textures/Texture.js @@ -1,18 +1,17 @@ /** * @author Mat Groves http://matgroves.com/ */ -var PIXI = PIXI || {}; PIXI.TextureCache = {}; PIXI.FrameCache = {}; /** - * @class A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used - * @augments PIXI.EventTarget + * A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used + * @class Texture + * @extends EventTarget * @constructor - * @param {PIXI.textures.BaseTexture} base texture {@link PIXI.textures.BaseTexture} - * @param {PIXI.Rectangle} frame {@link PIXI.Rectangle} - * @return A new Texture. + * @param baseTexture {BaseTexture} + * @param frmae {Rectangle} */ PIXI.Texture = function(baseTexture, frame) { @@ -24,9 +23,12 @@ frame = new PIXI.Rectangle(0,0,1,1); } + this.trim = new PIXI.Point(); + /** * The base texture of this texture - * @type #BaseTexture + * @property baseTexture + * @type BaseTexture */ this.baseTexture = baseTexture; @@ -34,6 +36,7 @@ /** * The frame specifies the region of the base texture that this texture uses + * @property frame * @type #Rectangle */ this.frame = frame; @@ -71,8 +74,8 @@ /** * Specifies the rectangle region of the baseTexture - * @param {PIXI.Rectangle} frame {@link PIXI.Rectangle} - * @return A new Texture. + * @method setFrame + * @param frame {Rectangle} */ PIXI.Texture.prototype.setFrame = function(frame) { @@ -86,8 +89,10 @@ * * Helper function that returns a texture based on an image url * If the image is not in the texture cache it will be created and loaded - * @param The image url of the texture - * @return {PIXI.textures.Texture} texture {@link PIXI.textures.Texture} + * @static + * @method fromImage + * @param imageUrl {String} The image url of the texture + * @return Texture */ PIXI.Texture.fromImage = function(imageUrl) { @@ -108,21 +113,23 @@ * * Helper function that returns a texture based on a frame id * If the frame id is not in the texture cache an error will be thrown - * @param The frame id of the texture - * @return {PIXI.textures.Texture} texture {@link PIXI.textures.Texture} + * @method fromFrameId + * @param frameId {String} The frame id of the texture + * @return Texture */ PIXI.Texture.fromFrameId = function(frameId) { var texture = PIXI.TextureCache[frameId]; - if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache" + this); + if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this); return texture; } /** * * Adds a texture to the textureCache. - * @param {PIXI.textures.Texture} texture {@link PIXI.textures.Texture} - * @param the id that the texture will be stored against. + * @method addTextureToCache + * @param texture {Texture} + * @param id {String} the id that the texture will be stored against. */ PIXI.Texture.addTextureToCache = function(texture, id) { @@ -132,9 +139,10 @@ /** * * Remove a texture from the textureCache. - * @param the id of the texture to be removed + * @method removeTextureFromCache + * @param id {String} the id of the texture to be removed */ -PIXI.Texture.addTextureToCache = function(id) +PIXI.Texture.removeTextureFromCache = function(id) { PIXI.TextureCache[id] = texture; } diff --git a/src/pixi/utils/Detector.js b/src/pixi/utils/Detector.js index 9450e44..b086f12 100644 --- a/src/pixi/utils/Detector.js +++ b/src/pixi/utils/Detector.js @@ -1,14 +1,14 @@ /** * @author Mat Groves http://matgroves.com/ */ -var PIXI = PIXI || {}; /** * This helper function will automatically detect which renderer you should be using. * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by the browser then this function will return a canvas renderer - * @param the width of the renderers view - * @param the height of the renderers view - * @return A new Renderer + * @method autoDetectRenderer + * @static + * @param width {Number} the width of the renderers view + * @param height {Number} the height of the renderers view */ PIXI.autoDetectRenderer = function(width, height) { diff --git a/src/pixi/utils/EventTarget.js b/src/pixi/utils/EventTarget.js index 3edb506..db8507a 100644 --- a/src/pixi/utils/EventTarget.js +++ b/src/pixi/utils/EventTarget.js @@ -2,7 +2,6 @@ * https://github.com/mrdoob/eventtarget.js/ * THankS mr DOob! */ -var PIXI = PIXI || {}; PIXI.EventTarget = function () { diff --git a/src/yuidoc.json b/src/yuidoc.json new file mode 100644 index 0000000..fc3f18e --- /dev/null +++ b/src/yuidoc.json @@ -0,0 +1,9 @@ +{ + "name": "The Foo API", + "description": "The Foo API: a library for doing X, Y, and Z", + "version": "1.2.1", + "url": "http://example.com/", + "options": { + "outdir": "../build/apidocs" + } +} \ No newline at end of file